| I approached learning Clojure the way I approach learning everything else. I survey the resources available, then pick the two best books. Ideally, I want them to come at it from different perspectives. e.g. one may place an emphasis on doing stuff with Clojure while another may be more about functional programming. At the time, they were: https://www.amazon.com/Clojure-Programming-Chas-Emerick-eboo... https://www.amazon.com/Joy-Clojure-Michael-Fogus/dp/16172914... I then wrote a data processing app in Clojure; consuming financial data and finding patterns in it. My suggestions are:
1) If this is your first time learning a functionally-oriented language, clear your mind from any kind of assumptions picked up from other languages. 2) Get a handle on the core tenets of functional programming: immutability, purity, composition, and functions as objects. If you know Javascript, then a lot of this stuff may already be familiar to you. JS is underrated in that department imo. 3) To me, writing programs with Clojure is akin to playing with Lego. You write your base functions, then higher-level functions which use those base functions, and so on. Functions all the way down. 4) Write something with it; it'll force you to decompose your program and think functionally. Clojure is a simple, opinionated language. I don't think you'll have a hard time picking it up at all. The hard part will be to think in a manner amenable to it. These days, I think Clojurescript has overtaken Clojure in terms of traction, so if you're into webdev, then CJS would be a natural next step. |
I'm hoping to follow a similar trajectory to you, but with Elixir instead of closure. At the moment though, I tend to do things the other way around: write the top level functions and then fill out the base functions.
So I'd start a module with
def whatever(something), do: something |> function1 |> function2 |> function3
Then I'll write function1, 2, and 3 and whatever helper functions they need. And so on until it works. Maybe doing it your way is a better approach: helps you think it through first.
(although I'm aware some would say that tests should come before everything else anyway)