Some surprising stuff JavaScript can do

As promised, here are some links to work real programmers are doing on JavaScript. First, from raganwald, the self-described passionate software developer with the mighty Viking name, a long examination of using block structures in JS. And from Eric Kidd, a guy who describes himself as “into compilers, robotics, and programming language design”, here’s a post about Ruby-style metaprogramming in JavaScript. Read on for my admiring comments.

I spend a fair amount of time reading other people’s blogs. I am amassing quite a trove of links, which in theory will be very useful when I try to remember a post I read a while back. Not all of my tags are purely practical though. I can’t resist amusing myself sometimes with a tag or two I know will seem funny later on when I rediscover it. One of these tags I’ve been using lately is ‘hardcore‘. And two of the blogs I tag this way are raganwald’s and Eric Kidd’s. (Although Lambda the Ultimate gets most of them, because, I mean, wow.)

First, raganwald does a very nice job describing something I tried to express in an earlier post: that anonymous functions in JavaScript make code easier to read and easier to refactor because, as he writes, using them “puts the things you use right where you use them.” There’s something satisfying about programming this way, and it’s not so much about accomplishing the job at hand as it is gaining a mastery and confidence about how programming solves problems.

Plus, I love his use of the verb “elide” to mark the point at which he’s removed some source code from an example. Although I’m far from a militant grammarian, I do like proper usage. When a sentence or even a word is perfectly chosen, reading it makes you feel good.

As for Eric Kidd‘s post, I think that people who bring the intellectual wealth of one programming language into use in another are Johnny Appleseed heroes. I have read his sample code, but I’ll have to have a much closer look at his RSpec port, because I’m very interested in automated testing in Javascript.