147 points · by ronjouch · 10y ago · 36 comments
I also welcome the continuous work to remove things which are difficult for beginners and make code less readable, like the backtick syntax and the prime notation. I mostly work with backend code, and I wanted to learn some JS but found the ecosystem hard to swallow. Elm offers a very practical, and quick to get started experience for writing reliable frontend. For a quick win with UI work, also check out the Elm-MDL library. https://debois.github.io/elm-mdl/
---
Coincidentally, I was watching MPJ's FunFunFunction today, where he talks about JS libraries that coerce HTTP statuses into JS errors, and he managed to articulate some of my frustrations with elm-lang/http. The library tries to be helpful by returning a `BadStatus (Response String)` error if the status is not a 20x code. An error is what I want sometimes, but far from always. The result is also a string, while most of the API's I interact with return JSON for errors.
https://www.youtube.com/watch?v=gRsyY0kzXfw&feature=youtu.be...
Compare this to Go, or even Fetch. You send a request, and you get back a response, with a Body, Headers and Status. A language error type is only expected in case of the request not succeeding, like a timeout. Here, the library makes 2 assumptions. That a non-200 status is an Error, and that the response is a String. These assumptions would be ok in a higher level library someone wanted to build, but as part of a core, they're too high level to work for everyone with the defaults.
I can say that development performance was 3x than the same developers in JS. Plus you don't have to write unit tests and deal with grunt/gulp/npm packages nonsense.
We got only one runtime exception - our state was saved in localStorage and pushed into Elm.embed when page was opened. If this format changes in Elm/localStorage - Elm fails to start. It would be nice to get some promise rejected when you do Elm.embed() and it fails to initialize. But we can write our own Json.decoders and parse state inside application - in such case we can even write data migrators for user data.
Next stop for us will be to rewrite some views into Elm and integrate them into huge our JS project.
The decision to write something with backticks or the pipe operator seemed to be a matter of personal taste, and I like a system where these less-important decisions are already made.
Only two of my main gripes: How come there's a whole key dedicated to superscript 2 and superscript 3? How many times a year does one use the key that's dedicated to the Greek letter Mu and the £ sign?
If we're lacking a key for `, howbout we change the ù key into it, given ù is used only in a single word in the whole language?
I agree the AZERTY layout sucks. But it's not alone in its messiness, even QWERTY's (un-) design continues to raise questions: https://en.wikipedia.org/wiki/QWERTY#History
> "I for one would make no design decisions at all taking French AZERTY as a consideration."
Let me expand that statement: you are a craftsman who refuses to adjust his product to a piece of infrastructure that will at worst never budge, at best evolve conservatively and regardless of what you think, hurting your users/customers and bringing you nothing but some pride of not stepping over a self-imposed line in the sand.
Don't you think that's unrealistic and a bit sad? Have you seen many US roadsign makers refuse to build mph signs and print km/h signs instead because metric is better than imperial?
The x-prime looked like the elm equivalent of mysql_real_escape from PHP.
I've only been using the pipe syntax and this makes things simpler; backticks are special syntax, pipe syntax is just another function.
Instead a bunch of language and syntax that I enjoyed was removed from the language, but I get better bug reports? The export button is broken unless I click "resume" which I find pretty odd.
I have to say I'm really disappointed, every release they just remove language features.
[1]: https://github.com/elm-lang/elm-platform/blob/11c8ecb81a58b8...
Haskellers are bad at coming up with informative variable names (and I say this as a Haskeller).
Evan hasn't mentioned anywhere that he's been removing features for the last year or so just to give us some big features later. If he has said that I would love to see it.