DEV Community

brandon flowers
brandon flowers

Posted on

If you've never looked at Clojure before...

women of nasa lego

If you've never looked at Clojure before, this brief article may be your first taste and I hope you savour the experience. Clojure is an alternative to Java. It features interop with Java meaning you can access core Java functions within Clojure. It is a server side language and thus you would also need either Javascript or ClojureScript to write web-based client code.

I'm working on a series of Clojure & ClojureScript lessons to help me learn the language, and I've completed the first lesson introducing map, filter & reduce which I'd like to share with you.

Why should you learn Clojure? If you are a fan of Functional Programming design patterns, you will appreciate the immutable nature of Clojure functions and its FP approach to server side development producing highly testable code. Like Python, Clojure also features a REPL where you can experiment and test functions of your program vastly speeding up development.

After a few weeks of writing Clojure and receiving valuable feedback from the much more seasoned Clojure devs at TODAQ, I've managed to get several pull requests merged into our master branch and I've mainly learned to simplify my Clojure functions by pulling out complex sections and breaking them up into smaller, more manageable functions, increasing code readability. Once you begin to refactor deeply nested functions, all those braces begin to make sense and you can achieve some nice terse, code clarity.

Top comments (1)

tux0r profile image

And if you don't want to have a complete Java stack on your server, Common Lisp with Parenscript should be easy to adapt. :-)