Lesson 2. A preview of Clojure key features

 

After reading this lesson, you will be able to:

  • Describe the key features of Clojure at a high level
  • Discuss the advantages of adopting Clojure

Clojure belongs to the large family of LISP languages. LISP was one of the first software language but for many years, LISP languages were niche languages not widely used. They have been mostly used in the academics especially in Artificial intelligence research.

In contrast to most LISP languages, Clojure is a pragmatic programming language. It was designed in order to be used in the industry and indeed it is widely used  especially in the domain of Web development as we will see in Lesson 3.

In this lesson, we will unveil many aspects of this design decision and describe at a high level what are the key features of Clojure that make it a pragmatic language that allows developers to solve real-life challenges. Most of those key features will be explored in details later in the book. Don’t expect to understand deeply at this stage the features exposed in this lesson. You can think of it as a preview of Clojure key features.

We could summarize the power of Clojure in a single sentence:

key

Clojure is a pragmatic, data-driven language that offers high power of expression to its developers.

In this Unit, we are going to explore 11 Clojure key features that can be grouped into three main themes:

  1. Pragmatic
  2. Data driven
  3. Power of expression

2.1   Dynamically typed

2.2   Rich collection types

2.3   Functional Programming

2.3.1   Functions as arguments

2.3.2   Functions that return functions

2.3.3   Anonymous functions

2.3.4   Collection of functions

2.4   Homoiconicity

2.4.1   What is homoiconicity?

2.4.2   Why Homoiconicity is important?

2.4.3   Types of parentheses

2.5   Immutability by default 

2.6   A powerful interactive development environment

2.7   JVM ecosystem

2.8   Extensibility

2.8.1   Powerful macro system

2.8.2   Macros provided by Clojure

2.8.3   Custom macros

2.9   Elegance

2.10   Portability: Clojure and Clojurescript

2.11   Summary