I have a pet peeve about how some of the more popular JavaScript libraries today have awfully awkward syntax (for these modern times in which we live). All these inline objects, terse names, passing function literals as arguments to other functions, and so forth. Icky readability. Sure, JavaScript is a very “expressive” language as they say. And yet ironically enough, readability of modern “fancy” JavaScript is on a downward trend.
The causes? The unfortunately reality that JavaScript is an interpreted language, and therefore slow. So we have to jump through all sorts of arcane hoops to make up for it. Here we are in 2007 and people are worried about kilobytes and counting characters again, long after wonderful inventions like language auto-complete and intermediate languages (IL’s) to achieve some compromise between interpreted and compiled languages.
Joel writes about how performance is a relatively short-lived problem since machine power and bandwidth are increasing so rapidly. My favorite part is:
Heck it’d be a complete rewrite; the whole programming model is upside down and recursive and the portable programming language has more parentheses than even Google can buy. The last line of almost every function consists of a string of 3,296 right parentheses. You have to buy a special editor to count them.
Cracks me up.
Closures and inline functions are to JavaScript what pointers were to C++. With all that extra power comes a lot of extra responsibility (read: risk) – too much for most people to have to deal with in all but about 5% of application development. Remember that a lot of system (low level) software is still written in C++ for its extreme speed and power, but most of us still use higher level (simpler syntax) languages.
