CLOJURE in Practice: Functional Approaches and Implementation Strategies

 

The pool of information regarding Clojure as a modern functional language is vast with no exaggeration. There have already been written a lot of articles, discussions, news about Clojure as a functional language together with its key characteristics, theoretical moments, and general insights. We decided to dive deeper and to offer our readers a bit different approach to Clojure nature and implementation strategies. The article will be focused on a more practical/applied side of the issue, drawing a parallel between Clojure and Java, and, consequently, the advantages/benefits of the first. However, the information will not be limited to those very features only. We will provide a short insight into the actual project Agiliway is currently running to demonstrate a visual picture of the Clojure functionality scope. Let us roll, then. 

Clojure is quick, simple, elegant, and highly dynamic. It has gained its popularity since the first days of existence. Rich Hickey (the creator) hit the target and made the routine of mainstream developers much more colorful and engaging than it used to be. So, what exactly happened, and what changes were suggested to ‘enlighten’ the world of programming? As there are a lot of them, we will stress only most general and relevant as compared to Java, highly popular programming language nowadays. 

Clojure vs Java 

Java community is one of the largest and most popular presently in spite of its chaotic landscape and many weak points. Javascript has rather special and complicated syntax and semantics; it is believed by the developers to have no beauty while being time-consuming, boring, something even ‘painful’ to write in. 

In its turn, Clojure has gained popularity of a modern practical Lisp, much better than Java, with a number of new tools to be implemented (nevertheless, one has to operate various constructions and modifications to make the best and most relevant tooling choice decisions offered).  

What do Java developers say about Closure? 

  • ‘Plain, simple and compact syntax and structure’ 
  • ‘Dynamic language’; ‘Wide-scope eco-system with versatile libraries and modern Lisp characteristics’  
  • ‘Great self-realization’ 
  • ‘Great architecture’ 
  • ‘Perfect symbiosis with React namely’ 
  • And much more. 

Obviously, the pros are numerous and diverse. It sounds to be really worthy to give Clojure a good try. 

Clojure project implementation/implication 

Presently, Agiliway team is developing a project based on a full-stack Clojure (nothing but Clojure). It means that our engineering team is developing frontend, backend, mobile and database with Clojure. Such an unification (as compared to Java namely) is another reward the Clojure brings as it allows better inner developing cooperation, understanding, etc. inside the very developing team members. The developers engaged have a perfect possibility to gain a good portion of experience much faster and more efficiently than with other programming languages. The practical benefits mentioned are due to the flexibility of the programming team and the JVM platform peculiarities. 

What about the challenges on the project? Frankly speaking, there have been no serious challenges to be discussed here. Everything runs smoothly, quickly, logically and in unison. That is another considerable advantage of Clojure. 

On the project, Clojure, as compared to Java, has given us a perfect chance to: 

  • Write the code needed fast- SPEED 
  • Use and share it on web and mobile platforms with minimum effort- FLEXIBILITY 
  • Decrease the number of source lines of code (approx. 40 lines instead of nearly 200 in Java) – SIMPLICITY 

So, speed-flexibility-simplicity (SFS) – three main features of Clojure to make it stand out in the background of a wide array of programming languages we have at the moment leaving a range of the latter on a periphery of the IT-sphere.  

In case you have not got started with Clojure yet, maybe it is high time to do it and experience the joy of programming. Clojure is for Brave, True and Smart, so go out and start the acquaintance; the reward may be right here around the corner. 

READ ALSO: CLOJURE: FUSION OF SIMPLICITY AND SOPHISTICATION