3 ms·
I've always felt there's a disconnect between two groups of people, those who use a language in their day-to-day work and those who approach it more as an objec
by saiojd 4y ago
I've always felt there's a disconnect between two groups of people, those who use a language in their day-to-day work and those who approach it more as an object of study (i.e. academics or hobbyists). The latter view bloat as a bad thing, while it's not the biggest concern for the former (who have more pressing problems!). So for Crockford an expanding language definition is catastrophic, but for people writing web apps, if 1 new feature out of 10 very useful then it's still a huge win.
- capableweb 4y agoI'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!
- tomgp 4y agomy feeling was that Crockford’s ‘…good parts’ was intensely pragmatic. About as far away from the academic approach you’re describing as i can imagine. A bigger, multi paradigm language makes it harder to read other peoples code as the chances are higher that they’re employing a different paradigm or alter a different idiom, a clear maintenance burden.
- saiojd 4y agoPragmistism literally means utility for problem solving. Who do you know solves problems using a Crockford-style subset of language features? Note that, no where did I argue that bloat is good. I only said that it was tolerable given that some new features are useful. Maintenance burden is a real problem, but is still tolerated in practice. I don't agree that subsetting a language is far from an academic approach. In fact this is what pretty much every PLT class does in order to make reasoning about language definitions easier.
- tomgp 4y agoIdentifying that subset of the language was paradigm shift in JS development. around 2008 when the good parts came out i don’t know any serious JS developers who didn’t take on board many of its lessons. examples: avoiding ‘this’, understanding the value of functions as first class citizens, understanding closures. these weren’t unique to crockford but by presenting them in an accesible plain spoken way he moved the state of the language forward. i do agree that there’s a need to weigh the value of new features vs bloat but id say 1 good feature in ten is pretty poor odds. another example of crockfords pragmatism is JSON which for all its flaws has been a real boon. edit: un-auto correcting “crockpot” :D
- saiojd 4y agoInteresting points, thank you! JSON is a great example, I understand what you meant now. That being said, I really wish JSON had comments :P
- irrational 4y agoAnd those new features are usually new/different/“better” ways of doing what you could already do in the language. You can totally use JS without using any of the ES6+ syntax.
- saiojd 4y agoDo you do this personally, or do you use ES6+?