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.  

Saturday, February 04, 2012

Delusions of Grandeur

Maybe it is just me, but I feel like popular culture nowadays wants me to constantly root for the bad guy.  There are all sorts of stories in which the main characters are either complete assholes, or outright villains, and the point of the tale is not to chronicle their eventual downfall, but their success.

Quite frankly, I don't get it.  I'm not sure why I should want these people to succeed, or how I am supposed to relate to them, especially when - as in the case with a lot of these stories - the actions of these characters greatly damage (or end) the lives of innocents, minus any semblance of guilt or remorse.

The most common version of this story can be seen in the many vampire themed shows/films/books still being released.  Vampires are supposed to be monsters.  Or poor souls who are cursed.  Vampirism is not meant to be a gift, and yet that's exactly what it is in pop-vamp stories.  Where's the story in which vampires have to actually fear death at the hands of someone greater than them?  I can't believe I'm saying this, but I'm starting to miss Buffy.

Another example is the popular anime Baccano, which is also about immortals, many of which who are mobsters in 1920's New York.  Again, am I supposed to be rooting for a bunch of murderous assholes who manage to cheat death time after time?  I watched the first episode, and I couldn't go any farther.

Most recently, I've been a bit bothered by the "found footage" film Chronicle.   A bunch of teens gain superpowers, and use them exactly how a teenager would - to get their kicks without regard to how their actions effect others, even if that means that people die.  The film is based around all sorts of cliched themes - the "main" main character is an emo kid with a bad family who decides to lash out the most once he's stronger than anyone else.  Chronicle takes overplayed themes like "person gains power, decides everyone else is now suddenly beneath them", and "deep down inside, we're all terrible creatures", and like everything else, presents them as new revelations which no one has ever pondered before.  

Look, I'm not denying that human beings might be miserable and awful by nature.  But dammit, I still want to have hope.  Hope that not everyone would act terrible if given the chance to break the rules without consequence.  Hope that if some weird supernatural occurrence did take place in reality, I wouldn't be dead on arrival.  I'm not trying to hide from reality — I just don't need constant reminders of how shitty people can be when I turn to a piece of entertainment.  

Furthermore, I'm disheartened when reviewers claim that the traditional superhero creed "with great power comes great responsibility" is hokey and unrealistic.  The point of the saying (at least in regards to Spiderman) is not to define how everyone will handle power, but how we should.  Because with nothing more than a gun, a criminal was able to bring Peter Parker's life down around him.  And it didn't take many neurons for Peter to realize that with his powers, he could do far more damage to far more people.  But after the loss of Uncle Ben, he knew  there was no way he would want to put good people through anything like he felt. That's why he became a superhero.  The saying, to me, is merely trying to encourage us to act the right way.  Calling it hokey is missing the point entirely.

I think that leads to the flip side of these stories — as much as they try to paint a bleak, realistic picture of how the supernatural would fit into our world, in another way they're a complete denial of real life.  For example, I'm not actually surprised to see a book such as Twilight portray vampirism as a free ticket to eternal life with lots of money and pretty people.  Young people tend to think they're invincible, and effectively immortal.  When they begin to get a bit older, and first start to ponder their inevitable end, you can expect a little bit of denial, in the form of some fiction that says that maybe, just maybe, they can escape it.  Or if they are younger, something that reinforces their beliefs.

However, when this kind of storytelling becomes popular with adults, and begins to proliferate to every corner of pop culture, I start to get worried.  It suggests that people refuse to shed their adolescent mentality, and accept and deal with the consequences and responsibilities that come with being an adult.

As for power fantasies like Chronicle, I wonder whether the point is to show what kids would do with superpowers, or to justify the natural (but unsustainable) feelings of isolation, rebellion and misguided superiority felt by (1st world) teens.   Kids are going to act like jerks for all the wrong reasons, but sooner or later they're supposed to grow out of it.  But in a world where the Internet lets us isolate ourselves from reality in the name of propping up the fantasy in our heads, you wind up with folks who will act like brats well into their mid 20's.  Read a certain way, a film like Chronicle says "do you know how feel like you have it all figured out, and all those grown ups are in the wrong?  That if you only were given the chance, you'd show them who's boss?  Well guess what? You're totally right.  And if really given the chance, you'd be fucking awesome.  No one could stop you.  And everyone else?  Their lives and hopes and dreams?  You were right about those too - none of it matters.  After all, you're the only one who isn't a sheep."

I don't need any of this.  Truth be told, I'm quite afraid of death, to this very day.  But I can't deny its existence, nor its inevitability.   And often times I do feel overwhelmed with the pressures of adult life.  My response to this is to simply do the best I can to get through it all.  Running away from it simply isn't acceptable, at least not for a sustainable period of time.

Fantasy is good as a source of escape, but there's a difference between escape, and fueling your belief that you aren't just another guy or gal trying to get through the day.

To put it another way, I  wish for a day when "just getting through the day" isn't considered a failure state in life.