Functional programming

As I continue to learn Elm, it seems the big payoff in functional programming happens during maintenance – the changes you make down the road. There is a learning curve, and writing the initial program is often harder than using an “easier” language like Javascript. However, when you go to make a change, and it is simple, you start to realize – this is pretty neat. Recently I wanted to sort the display of nodes in Simple IoT by description, so I made the following change:

Now I have a nicely sorted display:

In Javscript, this type of change would fill me with fear and trepidation. In Elm, was easy, and had zero worries about bugs or adverse effects. This is another example of the choice we all have – do we want to optimize for the short term or the long term.

1 Like