Monday, 23 January 2012

Now learning Javascript...

I've been rather busy of late. My month off from work ended and I started a new job. It's much better than the old job. We have a bar football table and everything.

So I picked up one of many copies of "Javascript; the good parts" that were lying around the office and started reading. While the author's style is appealing in its absolutism, he does move quickly. More worrying than his self-belief though is his determination to enforce encapsulation of code through various means, including the use of closures. (I can still type 'closure' with an 's', even in Dvorak.)

Now isn't that great - I hear you thinking - he's using closures to limit the scope of the code, and we all know how Evil code is, so limiting it's ability to confuse and be-muddle us must be a good thing, right? Well only up to a point. The amount of code required, and its complexity, left me unsure about the value of such techniques. ALL code is Evil. Even the fancy code you just wrote that makes everything wonderful and bakes you scones at tea time. Especially the fancy code. The more you like it, the less objective you will be when the time comes to re-factor it.

I haven't even nearly finished the book yet. But the two differing opinions I have are both strong. I am starting to see why.