1. 程式人生 > >I’ve been learning Clojure. Here is what I love!

I’ve been learning Clojure. Here is what I love!

1. Clojure Is Functional

I guess this title can be read in both the function programming style sense, and the “designed to be practical” sense, and while it is very much both I will be talking about the functional programing style here!

For years I have programmed funtionally in Javascript, holding myself

to a strict set of standards. They key to that sentence rests on the fact that I was “holding myself” to functional standards in a language that is not purely functional. After learning Clojure it’s clear to me now that if you want to program functionally its best to do it in a language that works with you, not against you. Since Clojure was designed to be functional all of those things that make functional programming hard in Javascript instantly vanish. Instead of hoping
that I can hold myself to those standards the language does that heavy lifting for me.

When it comes to talking about the benefits of functional programming verses other styles I find myself hesitant to dive into that now because there are papers on top of papers written by people more qualified to answer the question than myself. What I will say is that functional programming has greatly benefited me in terms of both simplicity and reliability. In addition, as a volunteer mentor at Code Louisville, I find that beginners have an easier time understanding functional concepts as compared to other styles of programming.

2. Clojure Is A LISP

This point really drives home one of the main things I hated about Clojure in the beginning, its a member of the LISP family, but I have come to view the LISP family with a lot of compassion and respect recently. The basic concepts are easy, even for a beginner to understand, but what has blown my mind the most is the concept of code-as-data.

I know its normal to mention Macros and transforming/extending the language when talking about code-as-data, but for me that has not actually been the biggest benefit. When creating real world programs we rely heavily on data, it’s an easy argument to make that without data most programs in existence today would border on useless. Since data and code are so closely reliant it only make sense to use a language where the code exists on the same level as our data. I know this may not be the greatest description, but I promise that once you start using the language you will understand what I mean.

3. Clojure Is Made By Old People

In the incredibly unlikely event that Clojure maintainers or contributors are reading this hold your horses and give me a minuted to explain myself. A more accurate title might say something like “Clojure is made by experienced people”, but being honest that title is a lot less fun!

Lets get to the point though. I have seen more wisdom and years of experience the Clojure community than I have in any other language community I have participated in. This wisdom is greatly beneficial to developers like myself who are at the beginning of their development career. I don’t want to re-solve the same problems that existed and were solved 10, 15, or 20 years ago. In other communities such as Node and Javascript I struggle with this greatly, it feels like every 6 months we are re-solving the same problems in ways that are not inherently better.

In my limited time in the Clojure community this has not been the case, I mean look at how few breaking changes exist in Clojure and ClojureScript compared to other languages and frameworks. Experience and wisdom are hard to separate from years of experience and the Clojure community is overflowing when it comes to experience and wisdom.

4. The Clojure Community

This is my final point, but my no means is it lesser than any other points. The Clojure community has been incredibly welcoming and has a strong desire to see positive growth. Having a great community will do nothing but benefit the language in the future!