Hello, Clojure!

Hello, Clojure!

Welcome!
I was hesitating about whether to write a blog on Clojure. Clojure is still considered a “niche” language in 2019. Nevertheless, although relatively small, the Clojure community is vibrant and growing. Writing a blog is also a reflective process, where the writer actually learns while writing. “The best way to learn is to teach,” said once, Frank Oppenheimer.

What can you find here?

Posts related to Clojure, functional programming, and maybe some other more or less related stuff. I plan to write quite a few basic level Clojure posts and then, build upon them progressively and write on the more advanced material. The order of writing is not guaranteed! But don’t worry, Clojure as language is quite simple and generally strives to simplicity. The syntax is surprisingly small.

On the other hand, learning Clojure is more about the functional programming mindset and learning Clojure’s excellent standard library. This might be challenging for some people, especially those who come from a lengthy object-oriented background. It is also a dynamically typed language, so for those of you who are used to type systems, Clojure is refreshing.

Worry not!

Clojure is worth learning. Clojure is a Lisp dialect. “Lisp?!” you say? Yes. That is a good thing. Lisp is the best language ever. Clojure is a charming language and is also quite a capable one. After you get used to all these parens, you find a language that:

  • General-purpose.
  • Supports concurrent programming very well.
  • Suitable for writing server-side code (when run on the JVM).
  • Suitable for writing frontend code (when compiled to Javascript).
  • Has a decent toolchain.
  • Has all the libraries of Java(Script) available to call directly without interop overhead.
  • With a syntax trivial to learn.
  • Is fast (almost) as Java(Script).

Clojure programs tend to be shorter than their counterparts in other languages, fast, and easy to read and maintain.

Above all, learning a functional programming language like Clojure does make you think differently about composing software and solving problems. It is not a silver bullet since there isn’t one. However, it is an excellent tool to have in your toolkit, be it an actual technology or merely a way of thinking.

Clojure is not just a toy or a POC. I have taken part in composing production backends that process over 1 million events per second- written only in Clojure. I am not a frontend expert, to say the least, but you can easily write Clojure code that runs equally well on both the browser and the server. 

Don’t get too excited about functional programming.

Functional programming is a hype these days. Just Google it and see how much electronic ink was invested into it lately. But hey, it was also a hype during the ’80s. Don’t get too excited about hypes in the software industry. Do get excited about ideas. Because of our very short memory, good ideas tend to get forgotten over the years, just to be rediscovered every 10-30 years.

A good software engineer learns new ideas. A good software engineer, with a broad toolset, will likely choose the “right tool for the job” when he will be tasked to solve a problem. Besides, when inspecting an existing solution or just reading code, a broad toolset in mind produces a less surprised and more critical engineer. We tend to be a lot less original than we think. Many times, when we solve something, it is probably because we have already solved something very similar in the past.
In short, gather tools.

Clojure is not perfect

If I hear someone who tells me about a programming language or a tool and claims that it is perfect, I conclude a single conclusion: He probably just have got to know it. There isn’t such. Clojure is also imperfect, and you will hear me beef about it. But as a general-purpose language, it is very pragmatic.

So good luck everyone, writer and readers.
Ido.

Clojure symbol
https://clojure.org/

Sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *

twelve + thirteen =