clojuredesign-podcast

neumann 2024-02-01T19:09:51.739749Z

Have you ever spent more time scaffolding a test than writing it? Must I/O-laden code be awful to test? Can simple logic be tested simply? In our latest episode, we need to test our logic, but the I/O is getting in the way. https://clojuredesign.club/episode/109-extractify/

neumann 2024-02-01T19:10:03.143139Z

What's the thorniest unit test you've had to write?

lukasz 2024-02-01T19:20:33.767249Z

I'm working on a legacy codebase where all stateful resources (connection pools etc) are stashed in dynamic vars, the run-in-test-context macro is 15 lines long, and that's just to make testing possible

😵‍💫 1
neumann 2024-02-01T19:28:31.497419Z

When I hear "dynamic vars", I immediately think "race conditions". 😆

lukasz 2024-02-01T19:30:32.263369Z

I haven't found any, the code is pretty ok, it's just not written in what I'd call idiomatic and with explicit mutable state management. But you never know!

neumann 2024-02-01T19:34:48.496929Z

So much of my Clojure learning experience has been learning different patterns and techniques than the ones I used in OO. I started by trying to "port" my OO thinking into Clojure, and now I write code that I can't imagine "porting" over to OO! 😂

lukasz 2024-02-01T19:44:37.731669Z

oh, my first attempts at writing Clojure was to emulate how Ruby/Rails worked - db connections appearing out of thin air, auto loading and all of that - it took a while to unwind :D

😄 2