3 ms·
Coming from Javascript, Typescript and Flow have huge benefits which a much smaller learning curve than going straight to Elm. I recommend people who don't have
by mambodog 10y ago
Coming from Javascript, Typescript and Flow have huge benefits which a much smaller learning curve than going straight to Elm. I recommend people who don't have experience with static types start with one of those two.
- iamwil 10y agoFor reference to those choosing: I started using Elm 2 years ago, also coming straight from Javascript. Elm wasn't without its frustrations. My biggest learning curve with Elm was a couple things. 1) Reading the type signature. I didn't know how to search for "->". But once I figured it out, and paired it with what I learned about currying, it made a lot of sense. 2) Earlier versions of Elm had non-descript error messages. Nowadays, it's fantastic, better than most. It was a main focus of the language for an entire version. 3) Figuring out how you operate on values wrapped inside a Maybe without unwrapping it with a case statement. Once I figured out Maybe.map and how to chain them together using Maybe.andThen, it got a lot easier. After I had more experience, my main slow downs were: 1) Still, figuring out how to chain Maybes together, when it's a bit more convoluted. 2) If you want to make a non-standard UI element, you still have to break out of Elm and do it in javascript, either natively or through ports. I was making a markdown editor at the time, and had to do this. 3) Decoding/encoding JSON from ports can be tricky with recursive data structures. It's easy when your data is easy. It is not if you don't control both ends, and can burn time getting it right. I've only listed the stuff I had trouble with, but there are many many things right about Elm. The design decisions are...tasteful. I don't know how else to describe it, other than it feels like someone put a lot of thought into it, and made all the right decisions--like how people think of Apple products. There are some rough edges, namely Ports, and a single giant reducer/update function. But the community is working on it. The one thing they did right is that you don't have to spend a day installing a lot of npm packages just to get an application up and running. So if you're thinking about trying Elm over Typescript, just jump into it.