A short introduction to Clojure

Clojure was released in 2007 and is a dialect of Lisp which is an old langauge from the 50s that is based on lambda calculus. The real challange when it comes to learn Clojure is not to get used with the syntax but to switch from an imperative mindset to a functional one (if you come from the OO world like me).

Why should you care?

There are a lot of reasons why you should care about Clojure:

  • When you get used to it, Clojure code is very clean, readable and powerful!
  • Immutability is default which makes your life a lot easier and the code more stable with fewer bugs.
  • Functions are simpler and more composable than classes and is a better ground to build systems on, in my opinion! 
  • Clojure is homoiconic and uses macros to "extend" the language in a way that does not require an update of the compiler. Macros replaces techniques like AOP and code generation that is used in other languages to create internal DSLs.
  • Clojure runs on the JVM, CIL and in the web browser (Clojure script). Virtual machines decouples the software from the hardware which is a good thing!
  • You can basically represent everything with Clojure, from data files and build scripts to back-end and front-end code.
  • Clojure is designed with concurrency and parallell execution in mind which is not the case for most other languages.
I would be very surprised (and disappointed) if Clojure and similar languages are not main stream within the next five or ten years!

Best regards,
Joakim Tengstrand


Post a Comment