How I Learned Clojure and Datomic at Shortcut
One core element that I love about being a software engineer is the ability to continue to learn new things. Before interviewing for my position at Shortcut, I had never heard of Clojure or Datomic. That changed once I was hired as a Senior Frontend Engineer.
I come from a full stack background, and have used a variety of programming languages in the past, but I had never used a functional programming language such as Clojure. Previously, I used a variety of SQL and NoSQL data stores, but had never used a transactional data store like Datomic. So, I was excited by the prospect of learning Clojure and Datomic, and I eventually switched over to the backend guild.
Here’s what it was like to learn Clojure and Datomic at Shortcut, along with some recommendations for others who want to learn Clojure and Datomic.
Read More: Clojure’s Polymorphic Tools
Clojure, officially, is a general-purpose functional programming language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming.
Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive agent system that ensure clean, correct, multithreaded designs.
Datomic, officially, is a proprietary database management system that allows updates in real time. Instead of assigning and overwriting values into named attributes, Datomic keeps track of all immutable facts over time, which sets Datomic apart because previous states can be accessed at any time. Datomic is also a distributional DBMS, which provides horizontal read scalability.
Another feature of Datomic is that it runs queries in the application server, as opposed to many other client-server DBMS, where the database server runs the queries.
In addition, Datomic leverages existing storage services like Cassandra, SQL and Dynamo DB, which provides more flexibility.
Read More: Continuous Empirical Planning
The Learning Experience
When it comes to Clojure, there are many tutorials, websites, and articles about how to get started (language syntax, set up a project, configure your IDE, etc.). There are also many tutorials, websites, and articles about how language features work (protocols, transducers, core.async, etc.). How you decide to get started really depends on your learning style.
I personally found the book Clojure for the Brave and True to be an excellent introduction to the language. It strikes a balance between humorous expression and practical explanations, making it not only informative but also enjoyable to read. Although I didn't end up finishing it because reading books is not my primary learning style, it now serves as a useful reference.
Pair programming was extremely helpful. At first, I sometimes felt overwhelmed and like I was "trying to run before I learned to walk" - working in a complex, mature codebase before having a firm grasp of the fundamentals. But the pair programming provided useful context that ended up helping to reinforce some of those fundamentals.
All this is to say that if you want to go down this path yourself, it is completely normal to feel overwhelmed when pairing at first, and I encourage you to stick with it for some time, because the concepts will eventually click into place.
My understanding of Clojure and Datomic can really be visualized as a logarithmic graph: the learning curve was steep at first, but then got progressively easier once my mindset became more accustomed to the fundamentals of both.
How Shortcut Supported My Learning Journey
Shortcut was totally cool with me switching from frontend to backend, and cool with me using work time to learn, which I really appreciate!
Our backend engineers were supportive and proactive; they quickly answered my questions, frequently offered to pair program, and identified items that would be good for me to work on. We have a mentorship program here at Shortcut which is enormously helpful.
Although I am by no means a Clojure expert, I have been able to "give back" by serving as an onboarding partner to a couple of new backend engineers and by contributing to our Clojure Curriculum for other devs who are new to the language. Shortcut is continuing to create a more robust curriculum to support other devs who join the organization without prior Clojure or Datomic experience. The backend guild also holds weekly Clojure office hours and daily backend syncs - an open forum to bring up anything backend, which can include questions on Clojure and Datomic best practices.
Recommendations for learning Clojure and Datomic
- Identify your learning style: books, videos, interactive tutorials, just jumping in and working on code, reviewing PRs, pair programming
- Make incremental changes to your setup. It can be tempting to make large changes to your dev setup when learning a new language, but when possible I'd recommend keeping config changes to a minimum so you can focus on learning the new language within a familiar environment. Upon gaining more familiarity, go wild with the dev setup changes!
- Pair program: switch between being the driver (i.e. the typer) and the navigator (i.e. the leader)
- Start small, start simple: begin with low-complexity changes and then gradually increase in complexity and independence
- Find a mentor and meet regularly
- Set SMART (Specific, Measurable, Assignable, Realistic, Time-related) goals: For example, I had a goal to be the primary owner of a 5 Story-point level of complexity Story within a quarter
- Find a balance between learning and leisure: I had the privilege of being able to dedicate work hours to learning Clojure and Datomic. But if you can only practice after work, be sure to pace yourself and balance learning with leisurely activities and rest.
Additional Learning Materials
- Clojure for the Brave and True
- The Joy of Clojure
- Video: Persistent Data Structures and Managed References (55min) describes the basic philosophy of Clojure
- Clojure’s Deps and CLI Guide where you learn how to install clojure and clj
- 4clojure: collection of problems with multiple levels of difficulty
- Video: Simple Made Easy (1hr) Rich Hickey emphasizes simplicity’s virtues over easiness’, showing that while many choose easiness they may end up with complexity, and the better way is to choose easiness along the simplicity path.
- Video: The Value of Values (58 min), Rich Hickey compares value-oriented programming with place-oriented programming concluding that the time of imperative languages has passed and it is the time of functional programming.
Congratulations on making it to the end of this article! Since you’ve made it this far, why not start your free trial of Shortcut?! 😀