Learning Clojure

Learning the syntax of Clojure is really quick (its very small and simple). Learning to think functionally and discovering the 700+ functions in the Clojure API can take a little longer. I recommend you find someone with a bit of Clojure experience to guide you.

Here is my suggested path to learning Clojure and thinking functionally. Many of the tasks can be done in parallel.

Simple rather than complex - the foundation of Clojure

Gaining an appreciation that systems should be simple is a crucial step truly understanding Clojure. So early in your journey into Clojure, spend an hour watching Rich Hickey talk about Simple made Easy - (transcript of talk).

Experience the Clojure syntax

Take a quick look at the Syntax of Clojure. The syntax is very small, so this will take about 15 minutes to 1 hour (dependent on your own experiences with coding). Don't try to remember all the syntax, it will come through practise.

Set up an enjoyable environment to work in

Find how to use Clojure with your favourite editor or IDE. Configure this tool so you can easily run a REPL and evaluate some expressions.

Building a frame of reference for functional programming

Find an introductory book that you like which provides lots of example code to help you feel more comfortable with the syntax and more importantly the major concepts of functional programming with Clojure. Type in the exercises as you read and don't be afraid to play around with code examples

Practice Clojure standard library (clojure.core)

Practice Clojure. Write lots of small and relatively simple examples in Clojure and experiment with the code in the REPL and try break things. This will start helping you learn the Clojure API

You should become comfortable in your understanding of:

  • basic values (strings, numbers, etc) and persistent collections (list, vector, map, set)
  • binding names to values and their scope (def, defn, let)
  • calling functions, defining functions, arity options for functions
  • Higher order functions and basics of functional composition (map, reduce, filter, etc)
  • Designing with data, Extensible Data Notation (EDN), data manipulation

Activities to help practice Clojure include:

Solidify some of the basics you have learned so far

Work on a relatively small project that you care about enough to work on

  • eg. a tool to help you at work

Learn more tools to help you think functionally

  • mostly using immutable values and pure functions
  • functional composition, sequences and transducers
  • atoms for managing mutable state changes (with immutable values)

Get a broader view of Clojure and learn some common practices

Start reading a book which is aimed at intermediate

Watch Video's about Clojure on subjects that are relevant to work or projects you want to work on.

Follow tutorials on Clojure, especially those that introduce the amazing libraries available in Clojure

Work with some of the most common libraries in Clojure

results matching ""

    No results matching ""