5 ms·
Been using Elm for a few months now. Both in small side projects, and in a production app for work. Many benefits over using js, and basically no downsides apa
by antouank 9y ago
Been using Elm for a few months now. Both in small side projects, and in a production app for work.
Many benefits over using js, and basically no downsides apart from the initial learning curve.
And even that could be equal to the learning you have to do every time your team decides to add/use a new foo.js library or framework to the project.
With Elm:
- you are confident about your code
- others ( and your future self ) can actually read it and understand it
- it pushes you to think before you write
- refactoring is a breeze, not a nightmare
I hope I won't have to use js on my next gig.
edit:
Also, I cannot speak highly enough about how helpful the compiler is, and the community in the slack channel. Makes the whole experience a joy.
- ChemicalWarfare 9y ago+1. Totally digging Elm as well. Learning curve is pretty minimal, although I've spent some time "playing around" with Haskell which helped. Love how structured things are and even though Elm is an "in progress" kind of thing - still no left-pad or js fatigue type issues (unless you really try to make them happen).
- boubiyeah 9y agoThat's just dynamic vs static typing though :p
- antouank 9y agoYou can say that. But, I also tried to learn and use OCaml and Haskell in actual projects. They are nowhere near as friendly and approachable as Elm to beginners.
- KurtMueller 9y agoElm is definitely in my future - in fact, many of the ML based languages are as well: Purescript, Haskell, F#, ReasonML, etc. Elm will be and is the gateway to all of that because it gives you only 1 path to traverse and tries to set up all the initial sign posts along the way.
- StreamBright 9y agoWell comparing Elm to OCaml or Haskell does not make too much sense. OCaml is a 20 years old multi-paradigm, general purpose language that is extremely useful for so many things (writing compilers for example) while Elm is a domain-specific programming language to be used in the browser. Apples and oranges.
- antouank 9y agoI didn't compare them in that sense. I only compared how easy it is to get started with. They share some concepts, like being functional languages and having good type systems. Elm definitely helped me understand many concepts in OCaml and Haskell. But to go beyond that, it's difficult.
- savanaly 9y agoHave you been using outside libraries that were written in javascript on these projects? I always anticipated that would be a downside of using Elm. I know there must be hooks to let you integrate pure javascript (jQuery-type) libraries and widgets into your app, but wouldn't it be really annoying? I'm writing Angular apps these days and one of the most time-consuming tasks is this sort of integration (for instance, right now I'm trying to add FullCalendar [0] to an app), and it doesn't work so nicely with the digest cycle of Angular, or play nicely with how data is passed around. And Elm is even more alien to javascript than a javascript app using Angular would be to javascript. So how is this area for you? [0] https://fullcalendar.io/ https://fullcalendar.io/
- antouank 9y agoNot really. I guess my approach is different. I only use a library when I have to, meaning that it's of "high quality" and it will save lots of time. Otherwise, I'd rather implement the feature myself, so I know the code and I can extend it later. In that sense, Elm covers me completely. There are many small good utility libraries to use, but I only use 2-3 of them. And most of them, you can read the code, quickly understand what it does and pick the code you want to use in your app.
- minikomi 9y agoAs an open question to yourself, or anyone else advocating elm heavily, can you show something cool you've built using the language? That would be the most convincing argument!
- _greim_ 9y agoI don't spend a lot of time advocating, but here are my first two attempts at building stuff in Elm. https://greim.github.io/elmsweeper/ https://greim.github.io/elmsweeper/ https://greim.github.io/electron-golf/ https://greim.github.io/electron-golf/ Honestly I think it would have been easier to build the first iterations of these in JS (React or something) but with the second->nth iterations, it became easier with Elm.
- nagyf 9y agoVery nice, thanks for posting
- minikomi 9y agoI'm seeing a lot of simple games on the built with elm site - do you think that's a sweet spot for using elm?
- _greim_ 9y agoNot sure, maybe. A lot of it might be that simple games are fun and relatively easy, so well suited for learning new stuff in your spare time. Then again, the electron golf game re-renders SVG DOM at 60fps. Building web apps that way hadn't occurred to me until React came along, and I didn't attempt it until Elm.
- antouank 9y agoWould this help? http://builtwithelm.co/ http://builtwithelm.co/
- minikomi 9y agoInteresting. Almost every site with multiple pages I visited had a lot of weird behavior when using browser back/forward. There's a lot of snake games, tic-tac-toes and 2048 clones -- I was looking for more along the lines of multiple page apps where elm made it a lot easier to build, and stories thereof.