learn-elm icon indicating copy to clipboard operation
learn-elm copied to clipboard

Elm vs React/Redux?

Open naazy opened this issue 8 years ago • 2 comments

Elm

Pros There are lots of very positive blog posts about Elm e.g. here

  • Beginner friendly

  • Quicker debugging due to very clear error messages e.g. screen shot 2016-11-29 at 12 52 57 screen shot 2016-11-29 at 12 16 22

  • No null or undefined

  • Total immutability -> makes it easier to keep track of state

  • Purely functional -> code can be more easily refactored

  • No runtime exceptions

  • Reactive

In this blog post, the author explains

The strictness of the type system eliminates an enormous amount — if not the vast majority of — mundane errors. Furthermore, refactoring is incredibly nice. Daniel Bachler had a relatable talk in BerlinJS not long ago: Fearless refactoring with Elm. The refactoring experience most of the time is: Make changes, any changes. The compiler tells what you missed. Go to 1. When the code compiles, it will work. There will not be any crashes. The only things that can go wrong are application logic. Application logic is what we should be focused on at all times, but many languages don’t let us do that. And since Elm enforces immutability and functional style, it is in fact very hard to cause regressions that you don’t know about. I find that when coding Elm, I get to spend most of my time thinking about the actual problem that I am solving. Whereas when coding JavaScript, I spend my time debugging and only every once in a while get to think about the actual problem.

Cons

  • Relatively new so potentially less of a community when we run into problems

React/Redux

Pros

  • Ability to keep track of state
  • Lots of existing components already
  • Javascript so potentially easier for us to get started at first
  • Bigger community

Cons

@dwyl/ateam Please add your thoughts 👍

naazy avatar Nov 29 '16 15:11 naazy

Excellent talk comparing the two by Evan (creator of Elm): https://youtu.be/jl1tGiUiTtI image

nelsonic avatar Sep 14 '17 17:09 nelsonic

:+1: :bee:

SimonLab avatar Sep 14 '17 19:09 SimonLab