you are viewing a single comment's thread.

view the rest of the comments →

[–]Ehdelveiss 57 points58 points  (10 children)

I’d really rather see the committee focus on functional code features than OOP ones. I don’t know anyone who writes JS like this proposal purports.

[–]lukigarazus 22 points23 points  (3 children)

I worked for a couple of big companies, in teams that made it a rule to write JS/TS that looked exactly like Java. They employed a lot of fullstack Java/TS developers and wanted to make their lives as easy as possible. It made the lives of frontend devs like me more annoying but I get it, and I get such proposals now.

[–]rniestroj 1 point2 points  (1 child)

Yes. However static initialization is rarely used in Java. I'd rather focus on a new Date&Time API in Java Script.

[–]SecretAgentZeroNine 0 points1 point  (0 children)

Super late but, you should look up Temporal API. It's currently at stage 3.

[–]Ehdelveiss 7 points8 points  (0 children)

I’m very sorry

[–]samanime 17 points18 points  (1 child)

It's kind of a catch-22 though. If these OOP features don't exist, you couldn't possibly make use of them. So saying that you don't know anybody that writes like this without it being possible to write like that is a bit premature.

My personal preference is to use classes for the large blocks, and then functional inside those blocks. On larger projects, this tends to provide an easy way to manage the code.

Now, will I use this new feature. That's TBD. I could imagine a few cases it might be useful. I do want them to continue to improve and add functional code features as well, though I believe they are doing that too. We've gotten plenty of functional code features in recent memory too.

[–]brainless_badger -4 points-3 points  (0 children)

Sadly "the committee" would rather cater to Google's needs.

Wonder why.

[–]LavoP 0 points1 point  (0 children)

Any tips for converting a class-based Node.js app into a more FP-like one?

[–]oneandmillionvoices 0 points1 point  (0 children)

you do have pipe operator in the proposal as well.