PurelyFunctional.tv Newsletter 344: Tip: thank a Clojure OSS dev today
From OO to Clojure Workshop!
Watch my free workshop to help you learn Clojure faster and shift your paradigm to functional.
Clojure Tip 💡
say thanks to Clojure open source developers
Open source work is hard. People demand a lot of you, and you work for very little money, if any. This goes for open source library, tool, and Clojure core developers. They could all use more messages of thanks for their mostly thankless job.
How to say thanks: keep it simple. "Thanks for all your work on X. I use it all the time and it helps me Y." A quick message over email or other social media is all it takes to brighten someone's day.
Book status 📖
I have new codes for my book. They give you 40% off of everything at Manning.
Feel free to buy my book and anything else that suits your fancy. I'll get a small affiliate fee :)
You can find my book, Grokking Simplicity, here.
About the book itself, I've found a pretty good layout for showing code progress. That is, code before and after small changes. A sequence of those pages can show a significant change to the code without losing the readers.
It's mostly a graphic design challenge. What font sizes, weights, and other typographical features make a) everything fit side-by-side and b) make it clear what's being changed.
You'd think this was already solved, but it's not. Most authors use the whole width of the page for code listings, then show progress by describing changes in prose. It works, but it's a lot of burden to put on the reader. I'm hoping this is one of the features that will set my book apart.
Currently recording 🎥
Another week without any new lessons in the Property-based Testing course. My apologies. I try to keep professional but life does get in the way.
Thanks for all of your messages of interest in Property-Based Testing. I am going to finish the course. It's an important topic and there isn't enough material on it.
Brain skill 😎
align your learning with purpose
Learning for learning's sake is great. Following your curiosity is both pleasurable and fruitful.
But curiosity is not always aligned with our desires. For instance, I want to learn Elixir and Rust. I'm curious about them, but that curiosity is easily quenched by reading high-level descriptions of them with a few code examples. I've accepted that curiosity is not going to drive my learning.
So I must find a purpose. I must find some purpose for which learning Elixir or Rust would really help. It's either that or force myself to learn them. But that sounds doubly tedious. Be both laborer and manager.
Purpose has a couple of benefits. For one, it has motivation built in. If I succeed, I have something to be proud of. The second benefit is that it forces me to stay practical. If I'm learning Rust to build an embedded device, I know what I have to learn and getting the software to compile and run is a practical goal. Otherwise, I could read endless documentation about the borrow checker. Purpose is clarifying.
So what purpose are you going to put Clojure to?
Clojure Challenge 🤔
Last week's challenge
The challenge in Issue 343 was to make a higher-order function that makes another function idempotent.
You can check out the submissions here.
This week's challenge
retry three times
One of the beautiful things about functional programming is higher-order functions. We write functions that operate on functions. This lets us pass around code to run later, bundled up as a function.
In last week's challenge, we saw how we could wrap a function in another to make it idempotent. This week, we will make a function that retries another function three times, or until it succeeds.
But first, what does it mean to fail? On the JVM, failure is commonly represented with a thrown exception. So, your task is to write a function that will call its argument. If it throws an exception, it tries again, up to three times total.
As usual, please send me your implementations. I'll share them all in next week's issue. If you send me one, but you don't want me to share it publicly, please let me know.