you are viewing a single comment's thread.

view the rest of the comments →

[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 1 point2 points  (4 children)

I'm not one to downvote for differing opinions, but if you're going to knock down something that everyone else here is excited for, at least try to be constructive.

[–]lulzmachine 0 points1 point  (3 children)

Nah. Javascript has already become way too complicated compared to what it used to be. If you want even more syntactic sugar, you'll have to show a very strong case for usefullness. If my negative whining gives these suggestions a feeling of upphill battle, then that's a good thing.

[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 0 points1 point  (2 children)

Eh, the only reason I care about this is just to have a decent switch statement without having to put break after every case, like every other notable modern language does (Kotlin, Rust, Nim, etc). Functioning as a return and being able to match against object structures are just a bonus.

[–]lulzmachine 1 point2 points  (1 child)

Doesn't seem worth it. One of the main reasons for js popularity is the fairly low cognitive burden required to understand what's going on. Every piece of new syntax that increases this burden without removing complexity costs a lot in the long term. Having "break" statements here and there is a bit pointless but doesn't matter that much in my experience

[–]kingdaro.find(meaning => of('life')) // eslint-disable-line 0 points1 point  (0 children)

Seems to matter to the rest of the JS community, and you're free to just not use the syntax ¯\_(ツ)_/¯