News for hackers. Stuff that matters.
Re:How I write Elm applications by valenterry on Sunday November 15, 2020 @08:10AM (#25100900)
A perspective from a backend developer who is spoiled from working with very good programming languages:

> Why isn't React still using `createClass()` and mixins? Why were ES6 classes and hooks invented? Why did JS add arrow functions and `async/await`?

Sorry, but all of these are mistakes. I predict that hooks will not survive the battle of time as well as react as a whole will. Arrow functions are mere syntatic sugar, but async/await was a mistake.

Re:How I write Elm applications by robertlagrant on Monday November 16, 2020 @09:09AM (#25111772)
Exactly! What's the point of a widescreen monitor if I can't have promises 10 levels deep?
Re:How I write Elm applications by valenterry on Monday November 16, 2020 @09:17AM (#25111853)
Any half modern language has a syntax construct for it. Unfortunately Javascript is on it's way but not there yet.

I could explain it, but it's already described here better than I could: https://gist.github.com/MaiaVictor/bc0c02b6d1fbc7e3dbae838fb... (scroll to "do-notation")

Re:How I write Elm applications by robertlagrant on Tuesday November 17, 2020 @03:06PM (#25128972)
> Now everything is good and JavaScript is great again, yet I wonder why it took so long

Have you read it? It's saying Javascript has something like that.

Re:How I write Elm applications by valenterry on Tuesday November 17, 2020 @09:09PM (#25132376)
No it's not. It is saying Javascript has asnyc/await which is just a specialization of the more general monad-o-syntax (or however you want to call it). And that is precisely what I meant.
Re:How I write Elm applications by robertlagrant on Tuesday December 01, 2020 @03:39PM (#25269585)
The article likes them; you said they're a mistake.