DEV Community

Sean
Sean

Posted on

Learn Clojure Interactively Using eBooks

I recently decided to learn a bit of Clojure. My first step was to setup my preferred editor with a Clojure plugin. The Clojure tooling allows a developer to write code in a text buffer, then use a keyboard shortcut to execute a section of that code in the REPL. This instant feedback makes for a really great developer experience.

After toying around a bit, I bought a copy of Getting Clojure by Russ Olsen from the Pragmatic Bookshelf. One of their download options is PDF format. I read through the first chapter, typing the code examples into a text buffer and using a keyboard shortcut to execute them in the REPL. Typing these examples got a bit tedious, so I started copying and pasting. That's when I got an idea.

If only I could open this book in my editor, then I could just execute the snippets without having to type them.

So, I converted the PDF to a .clj text file using pdftotext (I used the -layout flag for better formatting). Then, I opened the newly converted text file in my editor and was able to execute the code-snippets with a keyboard shortcut. Since this is just a plain-text file, I am able to modify the existing code and try things out with instant feedback. This is a really interactive and engaging way to learn Clojure.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay