Friday, December 4, 2015

A banana, held by a gorilla, in the jungle


A friend of mine and I were talking the other day, and he made a comment along these lines: Javascript is so useful because it does exactly what you want, including extensibility, without doing more than you need. In most object-oriented languages, if you just want a banana, you end up with a banana, being held by a gorilla, in the middle of the jungle.

I laughed since it was funny, although completely misguided. the basic point seems to be that object oriented languages are inherently bad. To me, the real meaning here is that all object-oriented languages still allow you to design your object hierarchy poorly and write really bad, bloated code. So does Javascript, for that matter. Put another way, with an analogy I use at the start of every course I teach: You can have a terrific vocabulary, know everything there is to know about grammar, and have memorized every guide on creative writing, but this does not mean you are currently capable of writing the next great American novel.

I don't say that to discourage anyone from being a writer or a programmer, but simply this: know what you know, and know what you don't know. But don't confuse what you don't know for what you can't know.

To quote Dennis Miller, I don't want to go off on a rant here, but since we're talking about Javascript, NodeJS is just a terrible idea to my way of thinking. I get wanting to write your server code in the same language as on your client, and I get wanting to write event-driven server code. These are both valid objectives. But what I just don't get is trying to smash nails with a wrench. Javascript was not designed as an enterprise-strength server language, and so trying to make it fit into that role just doesn't make any sense to me. This is why NodeJS has so many extensions to Javascript, and native-code plugins to do so much of the heavy lifting. But at a certain point, you've redesigned that wrench to be a hammer, so why not just use the hammer you already have? The only reason remaining is to use the same base language on the server as you do on the client, and now to quote Bernie Sanders, at the end of the day it's just not a compelling enough reason.