Ramblings about my attempt to learn Clojure in 2015

And why I believe you should try to learn it too

For most of my short-lived career, I’ve been using object oriented programming languages. I’ve worked with PHP, C#, Javascript (alright, not an OO language by definition, but conceptually very similar) and I also dabbled with Ruby quite a bit in the past year.

Another one of my goals for this year (this one I’m well on my way to achieve) was to learn a new programming language. Candidates were Rust, Go and Swift. I thought something was odd with this list, but I couldn’t quite figure out what it was. I had trouble deciding which language I wanted to learn the most among those three.

I had trouble choosing, not because I believed they were equally awesome, but because I thought they were a tad bit boring. Like just a new kind of syntax over concepts I already knew-boring. I did not want to learn a language for the sake of learning it.

What I wanted was to learn a new way of thinking. I wanted to learn something that would expand my horizons and disorient me. Something I would not easily learn in a weekend just to check my goal off the list. The language I would choose for my one-year journey needed to be one that is fundamentally different from all the languages I was familiar with.

Enter Clojure.

This was not the first time I tried to learn Clojure. My previous attempts were not very successful. I just couldn’t understand why anyone would want to program in Clojure. This weird (I even dared call it ugly) syntax, the fact I could not simply assign and modify a variable, the oh god so awful prefix notation, and all those bizarre functions that did not mean anything to me, were all things that were holding me back.

Clojure was one big opaque box to me. I tossed it to the side only because I didn’t grok it in a few minutes. A couple of months went by, and I eventually stumbled upon a talk by Rich Hickey. I don’t exaclty remember what talk it was, but it doesn’t matter. What matters is that something clicked inside me after watching that talk. Although I was still not convinced Clojure was for me, I started considering the fact that maybe, just maybe, something was right with this language. Rich might not the most engaging speaker, but there is a lot of wisdom in his words. Go watch all his talks. I mean it, they really are that good.

So I decided to give Clojure another try. I held my breath, pinched my nose, and actually tried to get something done. That time I appreciated the REPL a lot. It allowed a level of interactivity with my code that I had not experienced before. But it was still not enough. I got hung up with the mess of parentheses and still could not understand who in their right mind could code with that ugly prefix notation.

Nah, Clojure was definitely not for me. So I gave up. However, several weeks later I would watch another of Rich’s talks and that would spark up my interest in learning Clojure again, only to hit another wall after getting further down the rabbit hole. The way I felt about Clojure was the same I felt about Angular when I first learned it:

AngularJS Learning Curve

Although for Clojure the peaks were very short-lived, and followed by really long and painful downs. This back and forth kept going on for about a year, each time jumping over the wall that I previously stopped at. I ended up appreciating small bits here and there from the Clojure ecosystem.

Parentheses were not so bad after all. When you start learning about homoiconicity (whatever that means), you start to see beauty in the things you thought were ugly at first sight. Clojure syntax really is simple. And you also get used to the prefix notation, once you understand that an operator is nothing more than a function call. Then you learn about ClojureScript, and how you can share code between the server and the client (yeah, just like Node, but in a good way). And so on, and so on… You won’t believe what happens next! I couldn’t believe it either.

I actually started to like Clojure. That felt weird.

Fast forward to today, it’s now getting clearer to me why some people would use Clojure as their main programming language. I believe I have a good grasp on the fundamentals, and that I could now take on a bigger challenge: build something useful with it. But that’s a story for another article.

I would love to try and convince you to learn Clojure, but all this being fairly new to me, my explantions would confuse you more than they would help. There are very smart and talented people out there that can do a way better job than me at explaining Clojure and the rationale behind it. As smart as these people are, there clearly must be something right about Clojure that I still don’t understand. That’s why I’m pushing forward to learn it and you should too.

You’ll have to take my word for it. Seriously. Try it. And then persevere.

Like what you read? Give Marc-Olivier Fiset a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.