3 ms·
Also, I feel like the misunderstandings he posted are somewhat from the perspective of Ruby developers who learned CoffeeScript and not JavaScript. Which I do f
by ibrahima 13y ago
Also, I feel like the misunderstandings he posted are somewhat from the perspective of Ruby developers who learned CoffeeScript and not JavaScript. Which I do fall under, but I guess I quickly picked up the quirks in the language which CoffeeScript does make nicer. I guess things like `this` are a problem regardless of how you spell it but I think someone who learned JavaScript properly would learn about the scope rules directly rather than just assuming "it works like Ruby" and then being angry when it doesn't.
- Stratoscope 13y agoAh, that explains a lot. It certainly explains why the complaints didn't resonate with me. I know JavaScript very well, and there are things I don't like about it, but these weren't them. Or if they were, I've gotten used to them. I think I did miss the point with my previous comment. Maybe I was confused by the title: The article isn't "What's wrong with JavaScript", but as you said it's much more about things that will confuse Rubyists who arrive at JavaScript by way of CoffeeScript. For an article on that topic, it does make sense to have CoffeeScript examples. But it would be much better - and so easy - to include the matching JavaScript for each of the CoffeeScript files. Not only would it help JavaScript programmers understand the article, but it would show how CoffeeScript attempts to work around these issues. Even better would be to add matching examples of similar Ruby code. Code examples in all three languages would make for an interesting article: the Ruby way, the CoffeeScript way that makes JavaScript a bit more like Ruby, and the JavaScript way.