code-reviews

clojuregeek 2015-06-30T00:54:36.000586Z

suggestions on my clojure code I blogged about? http://www.clojuregeek.com/2015/06/27/simple-api-backend-for-development-with-atoms/

meow 2015-06-30T03:24:57.000589Z

@clojuregeek: there is also reset! for mutating an atom when passing in a function doesn't make sense, though your use of swap! and inc looks just fine https://clojuredocs.org/clojure.core/reset!

meow 2015-06-30T03:34:16.000590Z

I'm too tired to give it a serious code review, but I did want to point out one thing. I think your blog post lacks confidence and maybe you aren't giving yourself enough credit. Here's one example from your post:

6: Return the recipe. Maybe not needed? but it seemed like a good idea at the time.
It seemed like a good idea at the time because it is a good idea. The other atom mutating functions like reset! and swap! also return their new values, so it makes total sense to carry on that tradition with your custom add! function. So I say own those instincts, clarify anything you aren't quite sure about here on slack, and write with more authority - you're better than you're giving yourself credit for. Keep up the good work. :simple_smile:

danielcompton 2015-06-30T04:31:38.000591Z

@clojuregeek: simpliest -> simplest

clojuregeek 2015-06-30T14:11:53.000594Z

@meow: got it, thanks! :simple_smile:

meow 2015-06-30T14:17:04.000598Z

@clojuregeek: you're welcome :simple_smile:

clojuregeek 2015-06-30T14:43:04.000599Z

fixed typo, added reset, removed apologetic wording :simple_smile: … seems like in my add! function, all the work is done in the let, is that cool?