4 ms·
JavaScript used to be a little elegant in its simplicity. JavaScript now is getting complicated. Syntactic sugar, I think, is only there to build a moat around
by gentleman11 3y ago
JavaScript used to be a little elegant in its simplicity. JavaScript now is getting complicated. Syntactic sugar, I think, is only there to build a moat around a tech to justify a salary premium and reduce the number of newcomers. You end up with a dozen arcane ways to do the same thing, and you have to be fluent with all of them in order to read your teammates code. It makes the language harder to use, while adding no new functionality
- hungryforcodes 3y agoThis is really true. I feel somehow the problem came when the functional programming gang hijacked it and forced ES6 on us. Promises were so counter intuitive they had to create shortly after async / wait... Don't get me wrong there are alot of great things in ES6, but it was not quite the same language after...
- efdee 3y agoWhat would you prefer instead of promises? Callbacks?
- salwadordali 3y agoHow would you solve the async/await issue then? I think JS handles asynchronicity very elegantly. You just need to create a proper mental model around it. I don't want to go back to the old times of callback hell, that's for sure.
- manigandham 3y agoasync/await and promises are both just syntax on top of yield/generators. Most programming languages are just different syntax on top of the same core primitives.
- merrywhether 3y ago> functional programming gang This is a bit of weird assignment, given that the Class syntactic sugar over Prototype was one of the marquee features of that release.
- verdagon 3y ago> Syntactic sugar, I think, is only there to build a moat around a tech to justify a salary premium and reduce the number of newcomers. Ascribing that kind of motive to something as innocuous as syntactic sugar is silly at best. Most syntactic sugar I've seen is pretty clearly an attempt to make users' lives easier (whether successful or not is irrelevant). Source: am an actual language designer.
- roetlich 3y agoI love how this all went full circle. You know, just a few years ago, there still was the narrative of how bad JS is. Especially on HN. "Designed in only ten days", people made fun of it for being such a half-assed language. Stuff like the "Wat" talk, making fun of left-pad, etc. Now it's "JavaScript used to be a little elegant". Fantastic. More seriously: 1. This is typescript. Feel free to use js without it. (EDIT: This is wrong :) 2. This is a relatively easy feature, and there are equivalent features in some other mainstream languages. You don't have to like it, I'm not sure I do, but this feels so dramatic.
- johnfn 3y agoWhat? I'm the biggest TypeScript apologist today, and even I think that JavaScript used to be terrible! Remember `function`? Remember `var that = this`? Heck, remember `var`? Remember `.bind()` and having to bind all class methods? Remember `parseInt(08)`?
- baq 3y ago> JavaScript used to be a little elegant in its simplicity. Sir. Wat. [0] I could not possibly imagine a sentence I would be so vehemently disagreeing with. [0] https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat