Debugging with Elm 0.18
elm-lang.org
elm-lang.org
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.
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.
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 cost for people on AZERTY to just get a nice QWERTY layout, individually, is very small, and can be implemented on a personal level.
Units of measure have to be, more often than not, coördinated among multiple people, which increases the costs of migrating between them, making it less favorable.
I'd be a craftsman refusing to adjust my product in a way that benefits an extremely small subset of my users (people on a French keyboard) and worsens the experience of a major subset of my target audience (people on a keyboard with ` that have prior experience with this syntax).
Let's put it this way: If a programming language required the letter ù in its syntax, which being present on a French keyboard but not on most others, represents the inverse of the current situation, my advice would be different.
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.
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.
You are welcome to a dissenting opinion, of course, but throwing shade at Evan for his popular design decisions seems unlikely to change anyone's mind.
[1]: https://github.com/elm-lang/elm-platform/blob/11c8ecb81a58b8...
[1]: http://www.purescript.org/ [2]: https://github.com/ghcjs/ghcjs
Not sure what you mean here. Elm 0.18 has less compiler magic, not more.
So instead of:
map3 f ( x, cmd ) ( y, cmd' ) ( z, cmd'' ) =
I will have to write: map3 f ( x, cmd ) ( y, cmd_ ) ( z, cmd__ ) =
https://github.com/Fresheyeball/elm-return/pull/4/files#diff...And it affects package API too: https://github.com/elm-lang/svg/commit/40b761d66b48fcc28f5b5...
However that's just a matter of taste and does not deter me from continuing to use Elm.
Haskellers are bad at coming up with informative variable names (and I say this as a Haskeller).