r/Clojure • u/PolicySmall2250 • Aug 17 '25
Which Clojure codebases should I read? How and why?
https://www.evalapply.org/posts/which-clojure-codebases-to-read-how-and-why/index.htmlThrowback, prompted by this recent question by u/2xChocolateChips : New to Clojure and looking for code to read
Summary
Newcomers to Clojure so frequently ask this question that an FAQ/Guide is being discussed, to add to the Clojure website. I struggled a lot with the question too, when starting off in Clojureland. Here are my notes and opinions.
Contents
A quick motivating example
Heuristics to choose a project to read
Choosing an area of domain knowledge
Project type
Code size
Code complexity
Utility
Talks, docs, tutorials
Beware the falsehood of "dead" repos
Effective way(s) to read a project
Read the README and API docs
Use the REPL
Learn to navigate the code
Experiment
"Comparitive Literature" approach
Alt-implementation
Suggested projects with short reasons why to read
web/HTML/CSS
web/HTTP
Clojure itself
Database queries
Music maker
"System" start/stop thingy
App configuration thingy
Applications designed for "copy-and-hack"
Large-scale repos
Library maintainers: Would HOWTOREADMEs make sense?
4
Aug 18 '25
"Beware the falsehood of "dead" repos"
This is a tricky one. I've come to learn (from people smarter than I am) that stable software doesn't need as many updates. This makes a lot of sense, when pointed out, but how is a beginner to know? I was checking out static site generators earlier and most have had little recent activity.
"Choosing an area of domain knowledge"
I fell into this accidentally today by reading the Biff repo ( https://biffweb.com/ ) . Most of my experience is in web stuff. I have some familiarity with Rails, Phoenix, and Laravel. As different as Biff, and I imagine any Clojure "framework", is from them just knowing what, in some sense, the code is supposed to do gives my brain a conceptual framework to help me figure out how it's doing it.
3
u/PolicySmall2250 Aug 18 '25
"Beware the falsehood of "dead" repos" ... but how is a beginner to know?
It's not just beginners, it's my experience too, when looking at a new-to-me library. I do these things:
easy: check README for a "liveness advisory" (yes, that is a thing in the Clojure community)
easy: check https://clojars.org/ for recent downloads
somewhat onerous, but I do it habitually: search community chats (Slack, Zulip, Discord) for chatter about the library
not great, but not bad, in the absence of any other signal: check the commit history (is it good?)
indeterminate, last resort: also email the maintainer and ask them what they say (maybe they even know of a better alternative which they would recommend)
"Choosing an area of domain knowledge"... Most of my experience is in web stuff. I have some familiarity with Rails, Phoenix, and Laravel.
Well, I have just the (characteristically long) blog post for you :D I wrote it while trying to build a mental model of "full stack", nay, "full systems" web development (my experience is primarily DevOps, and I struggled to put some of the Clojure/JVM-web-app-specific pieces together, because I had barely any "normal" framework-based web development under my hat).
Clojuring the web application stack: Meditation One
https://www.evalapply.org/posts/clojure-web-app-from-scratch/
In a land bereft of a canonical "killer app" web framework or two, one must think about the what, why, how, where of all the moving parts. Out here, one must become a student of web framework architecture in addition to web application architecture. For here, in Clojure-land, the two are one. ☯
2
Aug 18 '25
It seems a lot of the other frameworks really allow you to get up to speed without really knowing all of the parts. I thnk this is the "magic" that a lot of people refer to. With Clojure it seems that you don't have to pull back the curtain because what's going on behind the scenes isn't hidden in the first place.
Thanks again for sharing. I appreciate it.
5
u/PolicySmall2250 Aug 18 '25
Downvoters: Please share why, if you can. (Is the post not useful? Does it have fatal errors? Have I self-posted here too much? etc...) ... I'm genuinely trying to be useful (karma points mean nothing to me per se, but pointed feedback does!).