Fork me on GitHub

Hello everyone, noob alert 😬 What is the best book for someone who has done object oriented programming all of his life till now and now has to work in a clojure project. I want understand all from its basic in easy terminology.


Brave Clojure is a great book for all types of beginners.


Do you mean "Clojure for brave and true"?

Cora (she/her)05:12:27

Getting Clojure

Cora (she/her)05:12:39

by far the best one for getting up to speed, imo


I haven’t read Getting Clojure but Russ Olsen is an excellent author.


However, the “best book” for any topic depends on the reader. I would suggest reading a few and sticking to the one that resonates the most.

Ben Sless06:12:33

Besides books, the official docs in Clojure's website are very good, and there are some early talks by Rich which really help "getting it"

💯 1

"Grokking Simplicity" by Eric Normand and "Data-Oriented Programming" by Yehonathan Sharvit, both do a great job of going over the fundamental functional concepts without being language specific. "Clojure for the brave and true" is still a great book for beginner Clojure.

practicalli-johnny10:12:45 has free books and videos to help learn and practice Clojure. Working through the 4Ever Clojure challenges is an excellent way to understand the core functions in Clojure. Try to get comfortable with REPL driven development approach, it will make learning Clojure a lot faster.


Hey, I'm building dead simple slot booking system for 1 event. Scale is about ~100 people. I need advice for database and deployment options. I was considering firebase for db and heroku for deployment. The cheaper the price and effortless the usage the better.


just use heroku and heroku postgres


one platform, probably at free tier

Dmitrii Pisarenko14:12:53

Hi! I've created a simple Reagent project which I want to use in this way: 1. I have some data objects (a bunch of nested maps and lists) which I edit in my favorite text editor. 2. These data are then rendered using ClojureScript/Reagent. 3. The data won't be changed by the UI. There are three subdirectories in 1. clj 2. cljc 3. cljs I assume that clj contains the server code, and cljs the client code (please correct me if I'm wrong). Question: Into which of these directories should I put my data object in order to be able to display it with Reagent in browser?


Cljs sounds right. Unless you did want to share the data with front/back, in this case cljc.


It’s also OK to mix your clj/cljc/cljs files under a single source tree. The Clojure and ClojureScript compilers will just ignore the code for the other side. Organizing this way can sometimes simplify your use of shared code/data.


I would put the data either under resources or in its own directory.


trying to mock a function out with, with-redefs - seems that, when I run a future, my redefs no longer apply, docs says its redefined for all threads, but future that was spawned inside the block seems to ignore it

Darin Douglass20:12:54

are you blocking on that future? it’s likely your future doesn’t fully complete until after you dropped out of the with-redefs block


no dereferencing of the future

Darin Douglass20:12:07

notice the following results:

user> (defn foo [] 1)
 user> (with-redefs [foo (constantly 42)]
           (Thread/sleep 100)
           (prn (+ (foo) 1))))
 #<Future@49e738f5: :pending>2
 user> (with-redefs [foo (constantly 42)]
           (Thread/sleep 100)
           (prn (+ (foo) 1))))


(defn z [] 42)
(with-redefs [z (constantly 41)]
  (prn (z))
  (future (prn (z))))
> 41 > 42

Darin Douglass20:12:42

yep. when dealing with with-redefs you have to make sure all work is done before you drop out of the form. otherwise you’re going to run into what you’re seeing


what do you mean.... ohh so i leave the form and then the future gets created... i see


so if i dereference the future, should be alright?

Darin Douglass21:12:10

yes, that’s one way to do it; though i’d say try to not deal with concurrency + with-redefs because it can get hairy

Darin Douglass21:12:21

maye rethink why you need a future in the first place


its for one-off task, but the task has io inside, the problem only exists within tests


yes, that helped 🙂 thanks a lot @U02EA2T7FEH