Re:ES2022 feature: class static initialization blocks
by arcbyte on Wednesday September 01, 2021 @07:32AM
(#28378507)
Why are we slowly turning javascript in java? This seems like a secret Oracle plot
[ Parent
| on HN ]
Re:ES2022 feature: class static initialization blocks
by snorremd on Wednesday September 01, 2021 @08:54AM
(#28379220)
Indeed. JavaScript was supposed to be scheme with its own object property inheritance model. Of course stakeholders co-opted the language and forced the Java style syntax (and name) upon the language. Now most of the syntax additions has been focused on turning it into some kind of C#/Java lookalike so people who don't like functional programming and the object paradigm used in JavaScript can pretend it's just like the OOP stuff they like.
Instead of trying to turn JavaScript into C#/Java, C# and Java should just support compiling to web assembly and provide a good standard library for working with browsers. /rant
Re:ES2022 feature: class static initialization blocks
by nerdponx on Wednesday September 01, 2021 @08:47AM
(#28379165)
I suspect it's because frontend web developers are jealous of other people using and interesting variety languages, so they want to incorporate as many features from those other languages as possible in order to feel like they are getting some variety themselves.
I don't blame them. That's exactly how I would feel!
That, or, it's easier to upgrade to a new JS version + let your transpiler figure it out, than to rewrite your code in some other language that compiles to JS.
Re:ES2022 feature: class static initialization blocks
by cygned on Wednesday September 01, 2021 @08:53AM
(#28379215)
I find Java code way more maintainable than JavaScript or TypeScript, to be honest. Especially since Java 11, the language has evolved significantly.
Re:ES2022 feature: class static initialization blocks
by junon on Wednesday September 01, 2021 @07:42AM
(#28378572)
Yep, the fact that TC39 seems to accept just about anything is really concerning to me.
I'm already fighting with people about integer literal separators not being supported in e.g. Vue and stuff, the more that's added, the more the community becomes fragmented, and I'm not convinced that transpiration (I hate that word...) is really paying off for us after all these years.
Re:ES2022 feature: class static initialization blocks
by bricss on Wednesday September 01, 2021 @08:09AM
(#28378800)
it's all about acceptance and being wide open
Re:ES2022 feature: class static initialization blocks
by lcam84 on Wednesday September 01, 2021 @07:57AM
(#28378688)
I loved the "good parts” of JS back in 2010. I think I don't need most of this new syntax and yet sometimes have the feeling I'm losing the train when I see this “C#” code base. Curiously, that was the technology I used to work before.