Scoping the audience and the need for a Clojure book for beginners

I am in the middle of a deep thinking process about the refinement of the audience and the needs for my Clojure book for beginners. Currently, the title of the book is “Get Programming with Clojure” but I am looking for a better title.

My purpose in writing the book is to make Clojure a language easy to learn. I believe it will help Clojure being more popular.

I need help from the community in order to clarify:

  1. who needs the most a beginner level book on Clojure?
  2. what is the exact need?

Here is where I stand for the moment in my thinking process. Please give feedback and share your thoughts.

Take into consideration that my motivation for writing a book is to teach more about the language and its foundation than to deal with tooling. It’s my personal preference.

I could make it fun and paraphrase Einstein by saying:
“Tools are for the moment and foundations are for the eternity”

My Assumptions

  1. Very few developers from outside Clojure want to learn Clojure from a book. Usually, developers learn Clojure from online materials, they start hacking with Clojure and then the need from a book might arise.

  2. Many Clojure developers know how to make things working on Clojure but don’t understand well the core principles of the language and how to apply them in their day to day coding.

  3. Developers that were able to become proficient in Clojure on their own don’t need a beginner level book.

Target Audience for a beginner level book

Developers that are already willing to learn Clojure but struggle with some aspects of the language. I would say developers with some experience of Clojure up to 2 years of Clojure.

Needs for the book

  1. Be at ease with the syntax
  2. Understand perfectly the foundations of the language
  3. How to write idiomatic Clojure code.

Non needs for the book
I’d like to claim that the following topics are not needed by the target audience

  1. Clojure IDEs
  2. Clojure build tools
  3. How to build a real application in Clojure

Suggested title for the book

Understanding Clojure

3 Likes

I’m glad you’re thinking about this! “Clojure is hard to get started with” and “Clojure is for experts” is becoming somewhat of a trope.

I’d like to suggest getting started with Clojurescript.

  1. A developer who is comfortable with Clojure, but not an expert in the JavaScript ecosystem (packages and build tools) who would like to get started with Clojurescript app development
  2. A guided path with clear goals that leads to a pleasant development experience. Concretely:
    a. What does a good development experience look like?
    b. How does one actually set up that devlopment experience?

To provide some context, let me provide my own history on the topic.

Lets go back to 2016. Meet Teodor. He likes programming, knows a bit of Python, Java and C#. He has dabbled with Haskell, and gotten bit by the functional pill. Haskell just feels right. From Java, so much can just be removed, things feel tight. But how does one deploy Haskell code? Compile a binary. Oh, so that’s dependent on dynamic linking and static linking. And I can’t just copy the binary to the server. I might have to compile it on the server. That means my 1 GB VPS runs out of memory. Ouch.

Enter Clojure! Run a lein uberjar, and your application code and static HTML files are collected into a nice little artifact that can be copied over to the server. Now that’s sweet!

But how do we do frontend development? Hmm. Teodor would like to keep the functional sweetness. And Clojure is nice! So Clojurescript sounds good.

… So he manages to compile some Clojurescript and put it on a web site, but its development doesn’t really feel like Clojure. You can’t start a REPL and talk to it. Instead, you must start a live-compiler (that does magic work in the background, not just running the forms you send to it), open a browser and connect to that running process from an editor. Which means you can no longer just start the REPL and do things.

Teodor never got further than compiling some javascript and linking it from an HTML page. Instead, he strode by GHCJS (Haskell to JS compiler) and PureScript before finding the Elm development process so simple that even kids could get used to it.

Time passes. 2017 goes by with a bit more Clojure and Python. 2018 comes around, and Teodor starts getting into “real” deployments where you have to think about servers, systemd, nginx, HTTPS, and finally begins to understand the concepts behind continuous delivery. He becomes comfortable making Clojure reach further than “build a jar and run it somewhere”, and looks into PAAS solutions like Dokku. He learns to set up his own Dokku instance on a DigitalOcean droplet, and find that to be quite nice. Not having to configure Nginx with Let’s Encrypt and run the application with a systemd unit file simplifies a lot.

All the while, he feels that he should be using ClojureScript. But he just can’t get that development experience down. With some responsibility for what the rest of his team is doing with regarding devlopment, he can’t recommend ClojureScript, but Elm’s compiler makes it easy to get started with, and the plethora of javascript video introductions means he can provide some pointers to teammates (hey, check out Vue, you might prefer that over using jQuery to modify the DOM).

All the while, he tries getting a solid REPL-integrated Clojurescript development experience. For Clojure, CIDER+Spacemacs works very well, but with Clojurescript, he runs into issues with missing CLJSJS libraries when he tries to use Figwheel, and turns to Shadow-CLJS. But that REPL is flakey. And he knows that probably won’t be a problem when he finally learns all the things that go on underneath. What really happens in CLJS repl? He just wants that C-c C-c to work with Clojurescript. He relies on documentation lookup and autocomplete from his editor – which again requires to be REPL-integrated.

As 2019 passes along, he seriously investigates Shadow-CLJS. Some pieces begin to fall into place. Perhaps jacking into a Clojure REPL and using the API to launch a CLJS repl from there is the way to go. He manages to fix a few of the issues he runs into using oz from Shadow-CLJS through the help of the maintainer and another kind soul. He feels that he is coming closer to a nicer development experience, but still wonders: is this the right target? Lately, working through Jacek Shae’s Learn Re-frame has been helpful.


So that’s been me. Easier to look back at it in the third person, I guess. Still,

how do the “real guys” develop ClojureScript? Are they just launching figwheel and debug through page reloads, or do they use the REPL? Do they ever have problems when something in React breaks, or do they all know Javascript in and out?

Considering you’re making Klipse, I guess you don’t have the same kind of struggles that I do! But that’s my suggestion. Hope it helps!

The first “scope” that sparkled in my mind was really different to what you have scoped: “Developers with some experience …”.

What I though was: “Non developers willing to learn to program”.

I haven’t done it, but I suppose that trying to teach somebody to program for the first time with Clojure will teach ourselves what things are unnecessary complexity for beginners (even for your audience).

About your assumption 1, I would say that any sample relative to the developers population is “small”, but the absolute size matter a lot. Those “few” relative to the world are still many: what is that number? how many developers from outside Clojure want to learn Clojure from a book? count me as one of those who proactively looked for a book, being the Clojure for the Brave the one I choose for beginning.

@jgomo3 Can you tell about your background and your motivation for learning Clojure?

Thank you @teodorlu for sharing your joy and your frustration with Clojure and ClojureScript. My motivation for writing a book is to teach more about the language and its foundation than to deal with tooling. It’s my personal preference.

I could make it fun and paraphrase Einstein by saying:
“Tools are for the moment and foundations are for the eternity”

1 Like

A mix of things:

  1. I learned functional programming with ML and Scheme at the College in one course named “Programming Languages”.
  2. Because of that I revisited the basics reading Structure and Interpretation of Computer Programs
  3. It was enough to change me forever so to code always favoring pure functions. At leas I learned how to avoid the Input/Output interaction everywhere. I coded with pure functions in Java, C, then in Python, then in Ruby. I couldn’t program “systems” in any other way.
    3.1. I have to mention that Python itertools and functools packages made me feel at home (those things are map, reduce, zip, etc.).
  4. Another big impact in how I work was the book “The Art of Unix Programming” with which I learned the concept of Data-Driven Programming, and how to actually design useful programs.
  5. Then I was told you can use functional programming language in the real life, I tried Haskell for a while but by myself.
    5.1. Finally, in one Job where complexity was killing us, I was immerse in the idea of Clean Architecture, and the concepts of Architecture and Design themselves, to solve this complexity problem. Also I was trying to convince everybody to try Haskell or at least to try functional programming styles in our code: Ruby/Javascript.
    5.2. A coworker had the same idea but he was influenced by the paper “Out of the Tar pit” and got immerse in Clojure and proposed it.
    5.2.1 The fact it was Lisp brought me nice memories.

So I tried Clojure for a while and ALL the things I mentioned were clicking together.

In that “while” I was reading the Clojure for the brave book but also watching all the videos Ritch Hickey videos. Those videos alone are enough to convince any professional programmer to use Clojure (probably not your audience).

1 Like

I agree with your Einstein quote. But the part that I love the most about Clojure (aside from all the great core concepts: immutability, data first, functional programming etc), is the feedback loop and development style. It was only once I started writing Clojure for a living that it really clicked, I just find it a shame that arguably the biggest selling point of the language (REPL driven development) was the part that I overlooked for so long.

It’s easy to use Clojure productively the way you would use any other language, without the REPL with a TDD (compile test) workflow, or compile run workflow. But in doing so you completely miss the point. Even when you are told about the REPL and how amazing it is, it’s hard to see the appeal of copy pasting stuff into a REPL window.

Then one day someone shows you that if you place your cursor at the end of an s-expression and hit the exoteric key incantation for your development environment that it will magically send that code snippet to the REPL and evaluate it. Suddenly you start to realise that programming Clojure is about interacting with a living program while it’s running an alien concept if you haven’t programmed in a Lisp before.

In short tools aren’t important, but Clojure has a fundamentally different tool than most other languages. The concept and value proposition of that tool needs to be explained otherwise it’s easy to miss out on what makes Clojure development such a joy.

3 Likes

I totally agree with you and I think that the REPL is not included in what I called “tools”.
What I would prefer to exclude of my book is more: IDEs and build tools and information about specific libraries.

thanks for this precious information

1 Like

I think a book that’s missing is something like: Learn programming with Clojure.

Basically, something for people new or still new to programming and computer science.

Or in a similar fashion, beginner books into specific domains:

  • Learn data science with Clojure
  • Learn web development with Clojure
  • Learn game development with Clojure
  • Learn data processing with Clojure
  • Learn scripting with Clojure
  • Learn robotics with Clojure
5 Likes

I feel this is one of the biggest mistake I think beginners make. If I assume by front-end, you meant web. Doing web development with Clojure using traditional HTML server side rendering is the easiest way to get started. Yet I think because ClojureScript exists, it seems most beginners don’t start there, but they start with ClojureScript. ClojureScript only pays off when you need very interactive web front-ends. Basically, if what you want isn’t a website, but a web app. Even then, your app has to have pretty complex interactive UX to justify ClojureScript. When that’s what you need, ClojureScript is great, but for anything else, it’s overly complex and mostly overenginnering in my opinion.

2 Likes

+1 for doing server-side rendering first, and I think that’s a great way to demonstrate some of the advantages of clojure. e.g. “Normally you’d have to use html with some janky templating language bolted on top (same thing for css + preprocessors), but with clojure (and hiccup, garden) you can write the entire site with a real programming language (plus a more succinct syntax instead of typing <></> everywhere).” My personal website is made with a mainstream static site generator (Hugo), but I’d like to move it to pure clojure eventually.

2 Likes

I see your point. Hopefully, in 5 years, none of this is a problem! I guess it’s possible to look at “web app fundamentals”, but in that case Web Development with Clojure already covers the topic.

Good luck! From what I’ve seen of Klipse, I’m exited to see where you end up.

1 Like

Hi Yehonathan,

First, congrats for your initiative. Good books to learn a new language are still an option (yes I know that videos, tutorials exist but books keep some advantages)

Some remarks:

  • I wouldn’t exclude build tools from the needed stuff. More precisely, I would dedicate a topic to the specifics of Clojure eco-system (REPL, …).
  • if possible, seek for help outside of Clojure community (people who are learning Ruby, Python, Java, …). Easy to say, difficult to do :wink:
  • Persona may help you in defining your content/audience (https://en.wikipedia.org/wiki/Persona_(user_experience))

Have fun !

Stéphane

1 Like

As a computer science professor, the kinds of books I’d most like to see are:

  • Beginning programming in Clojure (or Clojurescript) for students with no programming background at all

  • Learning Clojure (or Clojurescript) for students who have taken one or a few programming courses, probably in Python or Java.

The primary audience for both of these would be college students (in some cases maybe not even computer science students, yet), not “developers.” That said, targeting these audiences might also make the books useful to various non-college-student audiences, maybe in ways that will allow them to retain value as the ecosystem continues to change.

Coverage of tools/IDEs in these books should be just enough to get the student set up to engage with the process of learning and working with the language, much as many Python/Java intro programming texts walk students through some basic setup instructions and orientation. The tool options for beginners still aren’t quite what they should be IMNSHO, but they are improving and there are a couple of decent options these days (of which I’d prefer whichever has the simplest setup, gentlest learning curve, and a few key features like bracket matching and auto-reindentation).

I think about this a lot and would be happy to share more of my not-so-humble opinions on what such books should include. Depending on my teaching schedule, I might also be happy to help beta test drafts, etc.

4 Likes

I am a new programmer and am probably the target audience for this book. In fact, I already bought the MEAP. I think traditional intro books are not meant for beginners. They always take you through the basics…here is how you make a function, create a list, add to a list, do a loop, etc. The assumption is that you get the jist and can go off and start developing.

This really doesn’t help beginners because all you did was describe the different Lego blocks of the language, but the is almost zero discussion on how to put things together. I LOVED the little Schemer because it just got you coding, I actually started to get confidence. However, I couldn’t build anything afterwards. Now I think I found the Perfect book (really video series)…it is called How to Design Programs. It teaches how to to design with data, testing, and code (in rackett). It is a very systematic approach, but it highlights the importance of data and it’s relation to designing the overall program. Most other books only discuss the code.

In all, get the reader to code (and a lot of it), and not just example snippets, make them make decisions and learn from their mistakes, and let them build something useful.

1 Like
  1. All people new to our Clojure teams started by purchasing Clojure for the Brave and True (without anybody pushing for it!). Personally I prefer a book as well as I assume it will give me a coherent, well thought-through picture of the thing I am learning.
  2. I guess “getting” the principles is harder than getting the language so extra care should indeed be applied.
  3. Agree, I don’t need a book for beginners.

There are already books for developers interested in learning Clojure. Why a new one? How does it differ?

Regarding tooling - it’s perhaps ok to omit it but then you need to point to a good resource on this topic. The goal of the student isn’t to know the language but to be able to use it to do stuff. On the other hand, I believe that interactive, REPL driven dev is essential to the value and nature of Clojure and not so easy to get used to so leaving it out seems quite flawed.

Good luck!