DEV Community

Dwayne Crooks
Dwayne Crooks

Posted on

Why are you learning Elm?

I thought it'd be interesting to find out why you all are learning and using Elm.

I'd start.

  1. I have an interest in typed functional programming and Elm makes it super easy for me to explore my ideas and build them.

  2. I'm feeling the pain maintaining and adding features to a large legacy code base—containing a mixture of Backbone and React/Redux written in JavaScript—and I clearly see how the benefits of Elm could improve the situation. You can't imagine the simple bugs that occur that sometimes take us hours to fix. Those times can be demoralizing.

  3. Elm is my gateway drug. It made me see all the other typed functional programming languages from a different perspective. I started to see just how powerful the core of Haskell (i.e. Haskell without all those fancy and confusing extensions) really is. I started to understand the pattern that monads abstract. I started to feel excited about programming again. It's because of Elm I was finally able to build my first command-line app in Haskell.

And you?

Top comments (32)

Collapse
 
7hoenix profile image
Justin Holzmann

When it compiles I know it's not broken. It might not be doing what I want it to be doing... but I know its not broken. This is just such a freeing feeling compared to dynamic languages. Totally sold / hooked.

Collapse
 
dwayne profile image
Dwayne Crooks

Freeing indeed. I know all my code is checked at least once (due to the compiler). In JavaScript you'd have to write a test to make sure that the code can at least run (no misspelled variables etc).

Collapse
 
khrome83 profile image
Zane Milakovic

I spent some time trying to learn Elm.

What I walked away with was an appreciate for the architecture. But I hated the syntax. It seemed like the syntax was unnecessary. Something more familiar would have been better.

Otherwise the architecture pattern was amazing. Just reading it made me learn more and gave be a clear point of view.

Collapse
 
_gdelgado profile image
Gio

But I hated the syntax

That's bikeshedding, my friend!

Some people like it, some people don't. But should your like or dislike of syntax impact your decision to adopt a language? Not if the distinction between syntaxes doesn't impact productivity, learning curve or other objective criteria.

The syntax is (mostly) unimportant (see point above). It's like telling someone you don't agree with them because of the sound of their voice. It's super subjective. As as engineers, we shouldn't be swayed to make decisions based on subjective criteria!

Collapse
 
dwayne profile image
Dwayne Crooks

On point.

I feel the same way as well, i.e. syntax is mostly unimportant. It is the least important part of choosing a programming language.

However, I didn't feel that trying to convince any random person on the internet of that was worth my time so instead I tried to empathize with him because, let's face it, we've all been there (i.e. hating syntax) at one point or another.

It's interesting to note though that in the history of mathematics notation (i.e. syntax) has always been an issue:

  1. We took Leibniz's notation over Newton's for calculus. ref
  2. We dropped Frege's notation for something more convenient. ref
  3. And on and on.

But we always accepted the underlying ideas and concepts when we deemed them worthy of consideration.

Collapse
 
gdotdesign profile image
Szikszai Gusztáv

You might like Mint then :) It should feel more familiar than Elm, but has the same feeling to it otherwise (typed, quick, safe).

Collapse
 
khrome83 profile image
Zane Milakovic

I will check it out, thank you!

Collapse
 
csaltos profile image
Carlos Saltos

Yes, it's a weird syntax but after a while you get use to it and find the hidden value diamonds inside

Collapse
 
antonrich profile image
Anton

I actually enjoy the syntax very much. It is so simple.

Collapse
 
khrome83 profile image
Zane Milakovic

I can see the appeal, I just feel that it has some unneeded changes. Too many array structures and hard to follow.

That being said, my biggest issue is the HTML output in arrays. The method and flow part of the architecture makes perfect sense!

Thread Thread
 
dwayne profile image
Dwayne Crooks

It can be difficult to do but I try not to get hung up on syntactic issues especially when other features of the language bring huge benefits.

Thread Thread
 
khrome83 profile image
Zane Milakovic

I just feel that syntactic and readability is part of the developer experience.

Like I said, I’m the concept has a lot of great benefits. The choice to change the syntactics was stylistic and that I didn’t agree with.

If it ever releases with a cleaner easier to read syntax I would revisit it easily.

Thread Thread
 
dwayne profile image
Dwayne Crooks • Edited

Thinking about it a little more, I feel the same way as well. I guess we just have different tastes when it comes to syntax and readability. But that's fine.

Collapse
 
rametta profile image
Jason

I think I learned Elm for all the same reasons you listed.

Also am just tired of maintaining giant react apps that are slow and full of bugs.

Trying to evangelize Elm at work as much as possible these days in hopes of writing Elm full-time

Collapse
 
dwayne profile image
Dwayne Crooks

Trying to evangelize Elm at work as much as possible these days in hopes of writing Elm full-time

How do you go about it?

Collapse
 
rametta profile image
Jason

Making short presentations with demos, benefits/advantages over React. Sharing my blog posts about it, and overall just talking about it with coworkers

Thread Thread
 
dwayne profile image
Dwayne Crooks

Nice.

Is there a part of the app that you're working on that's been a constant source of bugs?

Maybe you can rewrite it in Elm to make an even stronger case for using it.

I like the approach Evan recommends here.

... it is important to be strategic in choosing your first project. Do not just write Elm code because you like it. Fix a problem.

Collapse
 
kirkcodes profile image
Kirk Shillingford

I want to make and design websites. But the current model of javascript, html, css, react, yarn, gulp, travis, etc. etc. It all seemed absolutely impenetrable, confusing, and frustrating.

Functional programming, and in particular, Elm's extremely safe and sturdy framework, provided a solid foundation to learn, while letting me get real results from the very get-go. I cannot understate how important the help of the elm community has been as well. The slack/reddit/twitter community have been extremely helpful.

I am rarely an early adopter, and I'm not sure if this counts, but I am definitely on the Elm train for the foreseeable future.

Collapse
 
antonrich profile image
Anton

So I wouldn't complain about TypeScript later on.

dev.to/parkroolucas/typescript-is-...

It's a well designed language and is worth learning just because of that. It has a great ecosystem and I think the language will be only better in the future. Unlike JavaScript which is just a bullion of million things.

Collapse
 
antonrich profile image
Anton

P.S. JavaScript has its own place (for me you can quickly hack something with it).

Collapse
 
__orderandchaos profile image
Order & Chaos Creative

I'm not

Collapse
 
dwayne profile image
Dwayne Crooks

That's cool as well. Care to share your reasons why?

Collapse
 
__orderandchaos profile image
Order & Chaos Creative

Mostly not knowing what I'd use it for. It's just not a language I've invested time in finding out about.

Thread Thread
 
dwayne profile image
Dwayne Crooks

For front-end UI development. Single-page web apps or for little widgets on the page.

What are you building? Elm could be a fit.

Thread Thread
 
__orderandchaos profile image
Order & Chaos Creative

Node/Python/PHP APIs, React/Angular Frontends. Some native JS on CMS templated/legacy sites.

Is it similar to how you might use Typescript?

Thread Thread
 
dwayne profile image
Dwayne Crooks

They're similar in the sense that TypeScript and Elm are both programming languages. But different in the features they emphasize. They make and value very different tradeoffs. And so depending on the tradeoffs that make sense for your projects you'd choose one over the other.

React/Angular frontends can be built entirely with Elm and the Elm architecture. With TypeScript you'd still be using React/Angular except you'd be writing it with TypeScript.

Thread Thread
 
__orderandchaos profile image
Order & Chaos Creative

Alright I'm in.

The Elm Architecture looks really cool.

Collapse
 
humrochagf profile image
Humberto Rocha

I always wanted to learn a functional language that I could use at my side project and eventually incorporate it into my development stack.

Elm felt like a glove for me to fill that spot.

I like the feeling of coding it, the language patterns, and the way how the HTML elements are treated inside the code.

Collapse
 
csaltos profile image
Carlos Saltos

Great !! ... thank you for sharing ... if you'd like to continue sharing Elm, I would recommend you this video tutorial udemy.com/course/elm-the-complete-...

Collapse
 
happydragos profile image
Dragos Bulugean

I wrote some things about why I would like to really get to know #elm intimately here: archbee.io/blog/10-open-source-tec...

Collapse
 
dwayne profile image
Dwayne Crooks

And did you get a chance to really get to know Elm? How was it?

Collapse
 
happydragos profile image
Dragos Bulugean

I didn't so far.