Clojure Study guide
A suggested study guide for those new to functional programming with Clojure.
MeetAMentor Clojure Study Group - 3rd November 2018 onwards
Week1: Overview of Clojure
Briefly discuss what the Clojure programming languages is good for, some example companies using Clojure and give suggestions on how to start learning Clojure.
- Simple Clojure exercises from ClojureBridge London workshop
- Understand the principles behind the design of the Clojure language by watching Simple made Easy by Rich Hickey (the author of Clojure)
Week2: REPL Driven Development overview and ClojureBridge London exercise review
Discuss REPL Driven Development (my blog post on the topic)
Week 3: Using the REPL and Structural editing
Structural Editing for Clojure development and the concept of code as symbolic expressions. Demonstrating the basic of structural editing using Spacemacs
Briefly covers the different editors that give a good Clojure experience. http://practicalli.github.io/clojure/development-tools/
Visit http://practicalli.github.io/spacemacs to learn more about Clojure development with Spacemacs (Emacs and CIDER).
- 4Clojure exercises
- Install a Clojure development environment using these install guides for several Clojure aware editors
Clojure sessions at London Java Community
I gave a talk on Clojure at the LJC conference on Saturday 24th November.
I will also attempt to broadcast live a lightning talk on how to broadcast live (because I like being quite meta some times).
Week 4: Live code a simple application
Build a simple application from scratch (probably a simple encoder / decoder)
Week 5: Clojure and Test Driven Development
Advent of Code - Clojure daily screencast and other efforts
Advent of Code is a yearly coding challenge that sets one challenge per day, just like an advent calendar.
Tim Pote will be live streaming their solution to the advent of code each day at 12 noon (UTC-5 timezone) on Twitch.
Borkdude also has a Github repository where advent of code solutions will be published, with all solutions checked with Clojure spec
This week we will look at Test Driven Development and Clojure.
clojure.test library is part of Clojure and is the simplest way to start with TDD and Clojure. We will take a small challenge and solve it by first writing a failing test, then writing some code to make the test pass, then refactor the code if necessary.
We will start by creating a new project on the command line with Leiningen, which creates parallel source and test branches.
lein new my-project
Open the source code file from the project (
SPC f f) and start the REPL -
, ' or
Toggle between source code and test code with
SPC p a. Or open the other in a new window using
SPC p f, highlight the filename and use
C-c o to open in new window.
Run all tests using
, t a or
M-RET t a.
To automate running of tests, toggle cider-auto-test-mode using
, T t and then evaluate either source or test buffer using
, e b and tests will run for that namespace
Joining the Live discussion
A hangout link will be posted to the MeetAMentor Slack channel and London Clojurians meetup page about 30 minutes before broadcast.
Week 6: Data Structures and Immutability
Understanding how to model the world with immutable data (values)
Week4-8: Thinking Functionally
- Writing your own (pure) functions
- using sequences
- lisp comprehension
- higher order functions
- functional composition.
Homework: various small challenges and 4Clojure exercises.
Resources for practising Clojure
Finding your own learning path
As there are many ways to study, please feel free to carve out your own learning path and share what you found useful if you wish. Learning Clojure section describes important steps you should take on your journy into Clojure.