2 ms·
I'm not a academic nor hobbyist but work professionally with JavaScript for more than 10 years. I'm also "against" the constant syntactic sugar that gets added
by capableweb 4y ago
I'm not a academic nor hobbyist but work professionally with JavaScript for more than 10 years.
I'm also "against" the constant syntactic sugar that gets added with little to no benefits, just leading to JavaScript having a large syntax.
Why introduce "classes" which are just sugar on top of existing syntax? Many examples just like this, where sometimes it feels like JavaScript has changes just to have changes.
Although I'm not gonna complain too much, many of the new features are more than just syntactic sugar and makes my life a lot easier. I just wish they were slightly more conservative I guess.
- LordN00b 4y agoTo take your argument to the extreme, why have for loops, when then are syntatic sugar over while loops? I'm generally a fan of syntatic sugar in a language if it's purpose is to simplify what's already there; but it is a balance between developer productivity and ease-of-use. I once saw javscript described as 'pithy', becuase of it's small syntatical footprint, that's probably not true so much now.
- ptx 4y agoI believe Crockford said in a talk [1] that he was going to stop writing loops when tail-call elimination is supported everywhere. Also, avoiding the for loop in JS might be a good idea because of how easy it is to shoot yourself in the foot with "for (x in stuff) ..." creating a global variable (when you accidentally leave out "var"). [1] Probably this one? https://www.youtube.com/watch?v=XFTOG895C7c https://www.youtube.com/watch?v=XFTOG895C7c
- kwertyoowiyop 4y agoIndeed. Just as with real sugar, a little syntactic sugar is great, but too much is icky.
- saiojd 4y agoI agree with you, but you also agree with me, I think. You said that, despite the bloat, you won't complain too much because some features make your life easier. That's precisely what I was saying!