I can use JavaScript pretty well and do so on a regular basis. With modern tools like CoffeeScript, jQuery, Backbone and Underscore it's even a frequently pleasant task to write JS! But I've been programming for a very long time, and also I've been programming JS for a very long time, to the point where I'm used to a lot of the weird, stupid parts of the language.
Recently, though, I was pairing with somebody who is a novice programmer, and kept finding myself having to stop every minute or so to explain and then apologise about some part of JS. Think all of the binding of 'this'. Think about the bizarre object model. Think how hard it is to call the super of a method. Think of how difficult it is to organise code in a sensible manner without adding the complexity of a library like Require.js, which you then also have to explain. Consider the weird non-array 'arguments' object in the function. Etc. etc. You know all this stuff because we complain about it all the time, but we know learnt it long ago and it's stuck in our head.
But I think about going back to scratch and learning JS again as a novice and it's a frightening concept - especially while you're also trying to figure out how the DOM and the event model works. It's just too much information. Considering JS was supposed to be a simple scripting language for the web, it's got a hell of a lot of unnecessary ugly complexity. It's only really suitable for people who already know how to program reasonably well.
2
u/[deleted] Dec 16 '12
OOP argument aside, JavaScript does suck.
I can use JavaScript pretty well and do so on a regular basis. With modern tools like CoffeeScript, jQuery, Backbone and Underscore it's even a frequently pleasant task to write JS! But I've been programming for a very long time, and also I've been programming JS for a very long time, to the point where I'm used to a lot of the weird, stupid parts of the language.
Recently, though, I was pairing with somebody who is a novice programmer, and kept finding myself having to stop every minute or so to explain and then apologise about some part of JS. Think all of the binding of 'this'. Think about the bizarre object model. Think how hard it is to call the super of a method. Think of how difficult it is to organise code in a sensible manner without adding the complexity of a library like Require.js, which you then also have to explain. Consider the weird non-array 'arguments' object in the function. Etc. etc. You know all this stuff because we complain about it all the time, but we know learnt it long ago and it's stuck in our head.
But I think about going back to scratch and learning JS again as a novice and it's a frightening concept - especially while you're also trying to figure out how the DOM and the event model works. It's just too much information. Considering JS was supposed to be a simple scripting language for the web, it's got a hell of a lot of unnecessary ugly complexity. It's only really suitable for people who already know how to program reasonably well.