Bug in the JavaScript

Music: "Piano Man" by Billy Joel / © Billy Joel / Columbia Records

My lyrical tribute to the world’s most misunderstood programming language. For the record, I absolutely love JavaScript - hell, I built an entire compiler in it just for fun - but… let’s just say it’s got enough weirdness that getting an entire song out of it really wasn’t very hard. ;)

Lyrics

It’s nine-o-clock on a Saturday,
You should be out having fun,
But there’s one bug left in the next release,
And you’re not going out ‘till it’s done,

You’ve checked all the database indexes,
You’ve tested your API hooks,
And you’re starting to think, that you might need that drink
‘Cos there’s only one place left to look…

There must be a bug in the JavaScript,
The bug’s in the single page app,
Because everything else was built properly,
But the front end’s a pile of crap

Now null is a reference to nothing,
Don’t mix it up with undefined,
And there’s zero and NaN, and Infinity, man,
Just remember which ones can be signed,
And you think that you’re working with integers,
When you’re really in floating point hell,
And your objects are hashes, but when your code crashes,
You’ll find they were functions as well,

It was never intended to do all this,
They say it was built in ten days,
But it’s out of the bottle, it’s going full throttle,
We’ve all caught the JavaScript craze,
Well we use it for code that runs everywhere,
From the cloud to your mobile phone,
But we’re sharing a string padding library,
‘Cos it’s better than writing our own

Now JavaScript’s not a bad language,
Though it’s frequently misunderstood,
But before you see what you can use it for,
Please stop to think whether you should,
Because just about everything’s true here,
It’s all part of the language design
Except zero, blank strings, the array of no things,
And the end of 1969