Elm Europe 2017: a Journey to Paris

Two weeks ago I traveled to Paris with Steven and Erik. For two days we were making history while visiting the first Elm conference in Europe. Time for a recap!

As you may have noticed, I’m an informed fan of Elm. I’ve been to the Elm Netherlands meet ups and it was only logical for me to travel to Paris for the Elm conference. A little sidenote: I gave a recap talk during the last edition of the meetup, my first meetup talk ever! Look out for the links to the recording on the Meetup page.

Thalys brought us to Paris and a 5-star rated Uber driver brought us to Villejuif, a 20 minute walk from Efrei, where the conference was taking place. First day we checked in and received some shirts and a very fancy wristband which served as nothing more than an entrypass. 

Growing Elm code with Evan Czaplicki

For those who don’t know Evan, he’s the benevolent dictator of Elm and creator of the language for his thesis in 2012. There were two keynote talks at the conference and this was the first. Elm as a language is still gaining in popularity and is quite different compared to the more well known frameworks / languages for frontend. The effect of this is that there is yet to form a consensus or best practice for writing and growing your Elm code or applications within the community.

For the two keynotes on Elm Europe and keynotes on other confs it seemed the focus is less on new language features or new modules or packages. Instead, focus is put on the way you can reason about your code and what habits or thoughts about quality of code you can forget when working in Elm. Evan explained this in a more holistic way of growing your Elm code. Together with him we followed ‘the life of a file’. Elm isn’t JavaScript and that makes refactoring cheaper and there’s less need to get architecture perfect the first time. For those who have tried Elm:

Would you rather change 20 files within a Elm codebase or a JS one?

One of two important lessons is that the number of lines in a file is no longer a measure by which you can say: ‘Here be dragons’. Reason for this: the Elm language and compiler provide developers with a lot of guarantees.

The other lesson: when you’re building your application and thinking of abstracting something away to a module, don’t. First build for your current use case and build it naively. Only when you have another use case that is clear revisit your code and try to decide what is similar or the same. The parts of your code that are the same can be abstracted, things that are similar should just stay separate.


Scaling Elm apps with Richard Feldman

What Evan did in his talk the first day, Richard zoomed in on. He gave more concrete tips on how to scale and grow Elm code. If you want to see a fully built out Single Page Application, here’s an example by Richard.

What I took home from Feldman's talk is that when building in Elm you can afford to keep on building and duplicating code. After a while you'll discover what can be improved or simplified. After that, do the refactoring. Rinse and repeat!

When you scale up an app, things happen. Specific code gets harder to find, and that’s because you need to keep more things in your head. Even developers are human and have limits to the number of things they can keep in mind. So the advices he gave were mostly about reducing that amount.

In short: 

  • Make sure you narrow your types, this way you decouple functions and make them more reusable.
  • Make it easier to filter out code to consider by being selective in what functions return. If it doesn’t return A, it doesn’t have an effect on A.
  • Steer away from a object oriented style of programming. Elm is a functional programming language and as such, Elm apps scale more nicely when built like that.
One of the things that stood out to me was the simplicity of the tweaks he made to the code and how he did it 2-3 times over. I suppose this means I should write more Elm code ;)

Would visit again

The conference was a lot of fun, I had a great time meeting a big group of Elm enthusiasts! It was nice to see that NoRedInk (a big player in the Elm community) was there in big numbers. All in all, it was a great way to network with mostly like-minded people and to see that there’s no single typical Elm developer. 2018 has a confirmed second edition and I’ll be going there again!

[Matthijs works as a developer for Infi]

We zoeken een ervaren developer!

› Wil jij je hersens bij ons laten kraken?

Wil je iets waarmaken met Infi?

Wil jij een eigen webapplicatie of mobiele app waarmee jij het bij anderen maakt?

Waargemaakt door de nerds van Infi.
Nerds met liefde voor softwareontwikkeling en die kunnen communiceren. En heel belangrijk: wat we doen, doen we met veel lol!

Wij willen het fixen. Laat jij van je horen?

Voor wie heb je een vraag?