Why Clojure?

Clojure is a small language whose primary goals are simplicity and correctness. As a functional language, it emphasizes immutability and declarative programming. As you’ll see, these features make it easy and idiomatic to write clean and correct code.

Web development has many languages to choose from and as many opinions on what makes a language “good.” Some languages are simple but verbose. You’ve probably heard people say that verbosity doesn’t matter—that if two languages are Turing complete, anything that can be written in one language can also be written in the other with a bit of extra code. We think that’s missing the point.

The real question isn’t whether something can be expressed in principle; it’s how well the language maps to the problem being solved. One language lets you think in terms of your problem domain, while another forces you to translate the problem to its constructs.

The latter is often tedious and rarely enjoyable. You end up writing a lot of boilerplate code and constantly repeating yourself. There’s a certain irony in having to write repetitive code.

At the other extreme, some languages are concise because they provide many different tools for solving problems. Unfortunately, this vast array of tools brings different problems.

The more features a language has, the more things you have to keep in your head to work with the language effectively. Soon we find ourselves constantly expending mental overhead thinking about all the different features and how they interact with one another.

What really matters is whether you can use a language without thinking about it. When a language is lacking in expressiveness, you become acutely aware that you’re writing code that you shouldn’t be. On the other hand, when a language has too many features, it can feel overwhelming and it’s easy to get distracted playing with them.

To make an analogy with mathematics, understanding a few fundamental theorems and their implications is far more useful than rote memorization of specific formulas.

This is where Clojure comes in. It allows us to easily derive a solution to a particular problem from a small set of general patterns. All you need to become productive is to learn a few simple concepts and a bit of syntax. These concepts can then be combined in myriad ways to solve all kinds of problems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.183.172