4 ms·
Thus far, JS has overwhelmingly been my favorite programming language. Expressive; amazing type system with TS; fast (V8 is an engineering marvel); and its ecos
by a_wild_dandan 4y ago
Thus far, JS has overwhelmingly been my favorite programming language. Expressive; amazing type system with TS; fast (V8 is an engineering marvel); and its ecosystem has frameworks/libraries for nearly everything, given its overwhelming popularity!
What makes reasoning about JS your code difficult, relative to other languages? Maybe the event loop is unintuitive? In my experience, opaque application states were caused by my odd engineering choices rather than any particular language. But I'd love to hear your experience.
- user3939382 4y agoThere are so many gotchas that I give up even trying to remember them, thus I just try the code to find out what it will do. One fun one that just came up is that async callbacks work totally different inside a forEach vs a for loop. https://developer.mozilla.org/en-US/docs/Glossary/Hoisting https://developer.mozilla.org/en-US/docs/Glossary/Hoisting I’m sure someone out there has compiled the list of things that don’t make sense. It’s like 100 people designed different features without talking to each other and glued it all together into one language.
- lenkite 4y agoIn one of my earlier JS projects, the coding guidelines strictly enforced the rule of declaring all variables at top of the function to not get confused by JS hoisting "magic". You need to enforce coding conventions in JS as soon as you have greater than one person working on a project. Sometimes even if you are the lone person - esp if you are coming back to it after a delay.