“Beating the Averages” is the title of Paul Graham’s famous article from 2001 about the advantages of Lisp in the product development business. 2013, 55 years after the inception of this family of programming languages, Clojure, a Lisp for the Java virtual machine is on everyone’s lips. Whether in the startup or in the product development team, research institute, bank or newspaper, Clojure is leaving a fair impression.
Nevertheless, the programming language that has been under active development since 2007, is all but invisible in the software contracting and consulting business in these parts. Why and how we want to change this is the topic of this article.
However, to actually recommend a programming language in good conscience, it needs to meet a few important requirements. Let’s have a look at Clojure against this background:
- Clojure is being actively developed and released under an industry-friendly open source license. With Cognitect rallying behind the language, both funding and professional support seem to be secured.
- Clojure compiles to Java bytecode, runs on the Java virtual machine and integrates seamlessly with Java components. From an operator’s point of view, Clojure is just another Java library. Existing investments into the Java ecosystem therefore retain their value.
- Clojure has successfully been used in software projects. It enjoys a large and lively community and is the topic of a growing number of international conferences.
- Clojure is documented comprehensively. Numerous books cover it to a great extend. A large number of open source libraries for all needs are available.
Disregarding its currently low level of distribution (more on this in the last section), the most important risks concerning the introduction of new technologies are reasonably well addressed.
While covering each relevant language feature would go beyond the scope of this article, I’d like to focus on those aspects of Clojure that in my opinion make it an excellent choice for software contracting for both customers and suppliers:
- Learning Clojure is relatively easy. The number of syntax element is considerably lower than in similarly powerful programming languages. The syntax by itself is very regular. Being able to work interactively with the REPL facilitates exploring the language and its libraries.
- State in Clojure is isolated and its manipulation can only be done explicitly. In practice, this help to avoid a whole category of bugs related to mutable state.
- The interactive nature of software development with Clojure speeds up feedback cycles on all levels. Therefore, Clojure is an excellent choice for rapid prototyping and agile software development.
- Clojure is expressive. Idiomatic Clojure code can consist of an order of magnitude fewer lines of code than comparable Java solutions. While lines of code is not by itself a relevant metric, given the huge difference, lower maintenance costs are to be expected.
- The Clojure community puts great emphasis on the concept of “simplicity“. This attitude is reflected by idiomatic code, preferred architectural styles, a lot of libraries and the general direction of the language’s development, further resulting in greater robustness and higher maintainability.
- As functional programming language, Clojure encourages the use of pure functions, resulting in better testability and comprehensibility compared to object oriented code of similar scope.
- Due to its special data structures and the concept of software transactional memory, Clojure is especially well suited for concurrent programming – a common requirement for server side software systems.
In combination, Clojure gives a comprehensive and elegant answer to a lot of questions that regularly arise in the software contracting business: maintainability, learnability and productivity are some of its strong points.
The biggest obstacle to a wider adoption in our business is the comparatively low supply of Clojure software development capacity. While most other concern regarding its use can be dispelled, the impression of a supplier market remains. This is where we as codecentric want to take action:
- We support the Clojure community in Germany (e.g. by sponsoring conferences, organizing local user groups and helping with the development of big open source projects like ClojureWerkz).
- We build up our Clojure capacities to be ready for our customer’s projects once Clojure becomes a viable alternative for them.
- We share our knowledge and experience with functional programming in Clojure by doing trainings and speaking at conferences.
If you are interested in this topic, we’d love to get in touch with you. Leave a comment here or write a mail to firstname.lastname@example.org.