6 ms·
What got me to love JS was probably learning about variable scope, closures, and async programming.
by z3t4 8y ago
What got me to love JS was probably learning about variable scope, closures, and async programming.
- pdpi 8y agoAs opposed to what other language?
- soneca 8y agoMaybe not opposed to any language.
- afandian 8y agoNot GP but variable scope in JS is very different to e.g. C, C#, Java etc. Superficially it appears similar, but the syntax is a faux amis.
- pjmlp 8y agoIs is very similar to Lisp, Clipper or Perl, also known in CS circles as dynamic scope variables.
- edflsafoiewq 8y agoJS's scope is really weird for (let i = 0; i != 3; i += 1) { console.log(i); // i refers to the variable defined below const i = 0; }
- geezerjay 8y agoThose features are hardly exclusive to javascript. Why did they made you love javascript but not any of the myriad of languages that support those features?
- tw1010 8y agoWhat makes you assume z3t4 exhaustively tried every other language before settling on JS? It's not typical that you present your opinion of a tv show by giving the few unique positive traits it has in contrast to the union of all positive traits from tv shows in the same genre. You just watch the show on a micro level, record what you liked about it, and report that, regardless of what the macro landscape looks like. That's the same way coders typically report preference about languages (on a micro level, not a macro level).
- geezerjay 8y ago> What makes you assume z3t4 exhaustively tried every other language before settling on JS? My point was that you'd be hard pressed to find a popular programming language that does not support those features.
- megous 8y agoSome historical perspective: Some languages picked it up along the way. So in my case, I only first found out about closures in JS, after going through several popular languages, that got closures only later on: Pascal, C++, PHP...
- weliketocode 8y agoI wouldn't say love, but I certainly now hold a stronger appreciation of JS after learning about many of its quirks and intricacies.
- epicide 8y agoThis is what I try to convey to a lot of people who keep making jokes about JavaScript being unpredictable and hard to program. Just like everything else (especially programming languages), you are limited by your understanding of the concepts. It's only as difficult as you make it. I think so many people think of it as a toy, never bother to actually learn how it works, and assume everything either does or should work like it does in other languages.
- tome 8y ago> It's only as difficult as you make it. Or as difficult as the authors of the code you're using made it.
- epicide 8y agoOh absolutely. No language is immune to bad code and bad APIs. A good developer experience requires diligence. That starts with a good understanding of the language.
- vinceguidry 8y agoWe're migrating an app from Ruby to NodeJS, and I keep hoping it'll get better, but everywhere I look, from the inconsistency and constant shifting of language semantics to the immaturity of the ecosystem, and how the former practically enshrines the latter, I can confidently state that Javascript is an objectively worse language. Attempts to solve problems caused by Javascript only make the whole thing worse. At the moment, I actually prefer vanilla javascript to ES6-7. ES6 is inconsistent in awful ways. You still can't rely on bindings to stay put and new additions like the splat operator just don't work the same way all the time. The more I learn JS, the more I hate it. I think eventually the web development community will come around, Node will lose mindshare, and compile-to-js languages will find their place in the sun again. I suspect that people who actually like the language are experiencing a form of Stockholm Syndrome.
- mellett68 8y agoWere there any tech reasons for switching from ruby to node?