A class I took in college called Programming Language Fundamentals introduced me to Haskell and it didn’t take long until I was utterly charmed by this language. It was my first taste of the functional programming paradigm and everything I did felt like solving a riddle. Haskell made me feel clever and while programming shouldn’t be all solving riddles, it is sure fun to feel clever. Before class one day, a friend who shared my enthusiasm (and who knew I liked frontend development) told me I should check out Elm. I searched for “Elm” and once google figured out I wanted the language and not “West Elm”, I found my way to their website and to the web browser wysiwyg. For once I had a hard time paying attention to my Haskell class because I was so interested in figuring out (and comparing) Elm.
At my job we use React and Redux — when I first started learning Redux I had a really hard time primarily because of the language around it. What the hell were reducers and dispatchers and why were actions not taking action? The names didn’t make sense to me and didn’t hold meaning to me so I had a rough time trying to keep it all straight in my head. Learning Elm was really valuable to me for this reason because Redux’s architecture was inspired by Elm’s architecture. Redux has
actions that get sent to
reducers that change your app’s
state; Elm has
messages that get sent to
updates that change your app’s
model. Learning this pattern with the word choice that Elm used, as opposed to Redux, helped me immensely. I could understand what a
message was and wasn’t confused why it wasn’t taking action.
Update is a word I use in my personal lexicon far more than
reduce. To be fair,
model were pretty 50/50 for me.
reduce really click. I had a hard time remembering that function and why to use it but then when I was doing a lesson involving folding, I realized “Hey, this is what reduce is!” This is another example where word choice affected my understanding — “folding” makes me think of when you lightly mix things in cooking so I had that visual cue to remember what it was called whereas
reduce doesn’t really give me that memory cue.
Part way through this I did stop and start wondering what I’m even doing and why. It’s not like I’m writing Haskell day to day. I wrote a scrabblizer that takes a message and translates it to the scrabble emoji code for slack but that’s about it. But then I just reminded myself that 1) I’m doing it because I just genuinely think these languages are fun and 2) they are teaching me lessons I can take elsewhere.