* ASM.js, in contrast, seems to be a case where something special is happening that can not easily be replaced by simply writing correct JS manually.
It’s not me, it’s you.
- everyone, at some point
I’m sure we’ve all heard this. I’ve even said it, though as I alluded earlier, I knew nothing. Also, in my own defence: AJAX and The Good Parts had not yet been discovered (yes, I’m old).
One of the phenomenons that Crockford points out is that a lot of people (most?) think they should be able to do productive work with this language without actually learning it first. It is both a testament to the power and elegance of JS and also a very strange line of thought for programmers to have.
I have found that the more I learned about the language, how it works, and, sometimes more importantly, why it works the way it does, the more my “hate” melted away and was replaced with appreciation. The wrestling match I once had with the syntax in order to make it appear more like a language with classes went away. My instinct to define functions with a name somewhere in the code and then call them from somewhere else, even when they were never going to be called again from anywhere else ever, went too.
I’d be willing to bet there are even more habits and conventions from other languages I've tried to blindly apply to JS that have since faded away.
“Generally the most important new innovations are received with contempt and horror.”
- Douglas Crockford
It’s sort of strange to me now that I also once subscribed to this idea. The idea that somehow some languages were inherently inferior to other “real” languages. In all ways. Especially given that almost all of the professional programming in my life has been done using PHP.
The Good Parts.
This book, along with the talks mentioned above, set me on a path of thinking about JS in a way that I never had done before. Not as a bad, or “fake” language, but as a real language, and also an important language. But, also a different language than what I was used to, a point I had not stopped to consider.
From The Good Stuff, I followed up with reading some other things and about some other subjects:
- The Little Schemer - http://mitpress.mit.edu/books/little-schemer
- Differential inheritance
- Lexical scope / Closure
After going through all of this, and thinking about functional programming in general, I can say I’m glad I have. My programming with JS had improved quite a bit and, perhaps more importantly, my experience with using JS has improved: I’m happier with it now.
I guess what I’m trying to say is, it’s alright, there’s plenty to like. It’s ok to like it!
Drupal 8 RESTful Services - Webinar
Using Entities in a Drupal Project - Webinar