React vs Elm: Creating a comment box component in Elm

2 min read

I recently published an article on CodeMentor.io titled “Building a Facebook-like comment box: a React tutorial in Elm” where I use the Elm programming language to essentially duplicate the React.js tutorial.

The article has code examples and a step-by-step on installing Elm, running the Elm Reactor and then writing the code for the comment box.

It has a brief comparison between React and why you would want to use Elm:

While the performance of React is awesome, at a certain point, you will notice that having React just isn’t enough. You’ll also want Redux, Flux, or some other data flow library installed. You will want Webpack and Babel installed so that you can use the latest features of ES6 (also known as EMCAScript 2016). Then you’ll probably want to add type-checking and static types at that point, so you will also need to install Flow, a JavaScript type-checker.

Elm will give all the goodies that React, Redux/Flux, and Flow give you but as a collective programming language rather than as individual libraries.

More Articles On Elm

It’s one of the first pieces of code I’ve written in Elm and I have been working on two other projects; one is an Instagram-clone, which I did an “office hours” live coding session for on CodeMentor.io, and the other is a live coding of a clone of the event creation page from the Universe.com website. I will talk more about those in future articles but you can check out the code for the instagram clone here and you can check out the code for the event creation page here. The instagram clone is licensed under the Apache license 2.0, the universe.com event creator is licensed under the AGPL.

I will be publishing another article on Elm very soon that is a continuation of the Instagram-clone code; it will include an API server to show how to use HTTP and AJAX calls in an Elm program, and it will show you how to embed and fullscreen an Elm component. This is vital if you want to use Elm today in an existing project and integrate components in a piecemeal fashion.

UPDATE: The 2-part article on creating an Instagram clone in Elm (instaelm) has been posted on Codementor:

 

Comments are Closed