Each week, we discuss a different topic about Clojure and functional programming.
If you have a question or topic you'd like us to discuss, tweet @clojuredesign, send an email to feedback@clojuredesign.club, or join the #clojuredesign-podcast channel on the Clojurians Slack.
This week, the topic is: "trying again". We throw our code in a loop, and it throws us for a loop.
Our discussion includes:* Sportify continues!
* When is it time to stop developing?
* How do we handle retries?
* What if you need to recur from catch?
* How do we recover mid-process?
* Where should the recovery logic go?
* Is there a way to get all the critical context at the same level?
* What should you preserve across a recur?
* What does it mean to be "loop native"?
* What is the basic structure for any automation?
* What is a "single application state"?
Selected quotes* It's a lot like having a project on a workbench. You have all of the tools and all the information laid out before you on that workbench. Nothing is tucked in a drawer or inside a cabinet. * That's a very important lesson for any developer: you can always stop—at least after it's working. * Nothing in the world is solved except by adding another level of abstraction. * I was not expecting that level of mutation! I was expecting a Kafka log written in stone! * The positive is it has everything. The negative is it has everything. * We would like more loop-native code inside of our cloud-native application. * Are you suggesting that just because we can, it doesn't mean we should? We're programmers! If the language lets us do it, it must be a good idea! * One of the reasons why I like Clojure is because it specifically tells me that I can't do some things that are bad to do. * All of the context is in one map. It has everything in it. One map to rule them all! * Might this be the fabled "single application state"? * We have the thinking function, the doing function, and the assimilate function.
Links* Sportify! series: + Ep 101: Sportify! + Ep 102: REPLify! + Ep 103: Explorify! + Ep 104: Assembleify! + Ep 105: Codify! + Ep 106: Robustify! + Ep 107: Idempotify! + Ep 108: Testify! + Ep 109: Extractify! + Ep 110: Contextify!