Learning a new language: Clojure
- select the contributor at the end of the page -
I've personally started down that journey recently by learning Clojure.
There are several reasons why this makes sense for me personally, and I'll share some of the main motivations in this article.
Clojure is a functional language.
I've programmed in imperative languages like C# for a couple of decades, so this definitely takes me out of my comfort zone. One of my very favorite features in C# is LINQ, which gave me my first glimpse into the functional style of programming. Embracing Clojure means embracing seqs (seq is an abstraction representing a sequence), and if you enjoy LINQ, you're going to love seqs.
Clojure is a dynamic language.
I've felt pain many times where static typing and all the ceremony around it (interfaces, classes, etc.) feels like it gets in the way of my productivity. I know I've solved the same problems over and over in the context of different static classes, and I'm curious if there's a better way, or if there are just dragons of a different sort lying in wait for me there. I'm going to find out!
Clojure embraces immutability.
And it does so in a very pragmatic way, with immutability as the default. This allows you to keep mutation segregated in a layer above the majority of your application logic, where pure functions are the norm. Pure functions are easier to test because of their lack of side effects. Our team's investigation into DDD has led us to find innovative ways to implement immutable value objects in C#, including using immutable persistent collections. I've personally seen the benefit that immutability can bring, and I love that in Clojure you get all of this by default, with a minimum of ceremony.
Clojure will push me to work on new platform.
I've been using a PC for way too long. I've always had a fondness for Unix. The tools that make Clojure programmers productive (Emacs, etc.) will push me outside of my comfort zone. My MacBook is now getting lots more use, and I'm pretty excited about that - it's a delightful piece of hardware.
Clojure is a language I would feel good about teaching to my kids.
My kids have expressed interest in learning to program, and I've been searching for a language that I would feel good about teaching to them. I decided against C# because I don't want them tied to a single vendor, even though the tools there are pretty intoxicating. Besides, I want to go on an adventure of learning alongside them. I considered Java, but ouch - that really felt like a step backwards. I strongly believe that functional programming and Clojure in particular has legs, and I want to give my kids the best possible leg up should they choose a career in CS. This was what pushed me over the edge to really start exploring Clojure as a language for my own personal growth.
More to come.
I'll post more as I progress in this new adventure. Perhaps some of you readers will join me on my journey!