Sunday, February 12, 2012

Javascript

I'm currently trying to come to terms with the continued rise of Javascript in all areas of web development.  Nowadays Javascript can be used to drive your web application, your UI's nifty graphical effects, and even the web server itself. It is everywhere, and can seemingly do everything.  If you want to work on the web, you need Javascript in your toolbox.


I find this to be disorienting to say the least. Back in the day, I was never a Javascript user, so I still see it as a toy language, something used to help validate forms and create annoying alert boxes.  I also remember its reputation as being the bane of performance and security minded users everywhere.  How is it that a language with so many negative traits become the de-facto future of the web?  Hell, how is it that such an old language became the future?  Usually, when developers want to solve a bleeding edge problem, they abandon the old and reinvent the wheel (even if it isn't necessary).


Some proponents say that Javascript was always a useful language, but it took a long time for anyone to take it seriously.  I can actually buy this reasoning.  In our modern rush to make bigger and better web based applications, we often forget that traditional programming and website design are two separate skill sets.  Being good at one is no indicator as that you'll be good at the other.  In fact, I'd say in many cases, being good at one means you're probably terrible at the other (I know no one likes stereotypes, but look at the interface for any open source project that isn't large enough to have dedicated graphic designers.  It probably doesn't look pretty).  


Thus for most of its life, Javascript was relegated to a realm in which the people who could get the most out of it were the least likely to use it.  But as everyone began to agree that the future was on the web, more programming wizardry was required.  And with Javascript being the most ubiquitous programming language of the web, it was eventually put through its paces.


So in thinking it out, I see and agree that Javascript is a legitimate and powerful language.  But I still can't help but feel like it is being utterly misused, even in instances in which it has been put to good use.  Prior to this post, I spent some time reading up on the language, including skimming the Javascript: The Good Parts by Crockford.  It featured some easy to read, easy to grasp code examples which did much to prove the language's worth.  But when I look at JS libraries, such as Dojo, and JQuery (actually, no, JQuery isn't too bad), I see the opposite: ugly code which uses Javascript's weakly typed nature to screw with the syntax, as if each one wants to put their own unique stamp on the language and make it look like something entirely different in the end.  I wouldn't want to reinvent the wheel when a library could do the heavy lifting for me, and yet I wouldn't want to use a library that makes my code unreadable as Javascript.  


And this is where I get to the root of the problem - real programmers have finally forced Javascript to flex its muscle, but I can't help but feel like most of the people using it aren't real programmers.  They're web guys who are more than happy to cut and paste someone else's code in order to get their frontpage to do flips and make AJAX calls.  It also seems to attract young and/or inexperienced programmers, who want to jump in with the hottest trend without having a solid understanding of the fundamentals.  And then there are the genuinely smart guys who are either misguided, have an ulterior motive, or aren't quite as bright as they appear.  Put all these camps together, and you wind up with something like node.js, which by appearances looks like a cult based on nothing but hype and circle-jerking.  


I will lean me some Javascript.  But I'm going to do my damnest to learn it the right way, and only use it when I have a real use for it.  I'm not a wizard programmer myself, but if I'm going to step into the future, I want to do it the right way.  

1 comment:

Anonymous said...

I've never been a fan of any third party bolt-ons in web pages, be it java, flash or anything else. The concept if the world wide web, using plain html to display pages in any browser is perfectly sound, and all these additional technologies undermine this.
As a developer, its probably professional suicide to bury ones head in the sand and fail to embrace this modern features, but I suspect most users are happy to keep things simple and avoid the hassle of browser plug-one, wrong versions of players, and script errors, etc...