Clojure Tip 💡
I recommend the AdoptOpenJDK builds for most people.
Oracle recently changed their licensing terms for Java. Now, the Java Development Kit is free to download, but requires a paid commercial license to run it in production. They are still building OpenJDK, but they are only supporting each version for 6 months, with no overlap between versions. These two releases make them unsuitable for most individuals and companies. The one exception is if you want to buy the license from Oracle.
If you don’t buy the license, a third-party build is your best bet. There are a few options, but the one I recommend is the AdoptOpenJDK build. It’s a community-run effort to support, build, test, and release downloads of OpenJDK with security patches applied. They plan on having 4-year LTS support, which gives a 1-year overlap with the next LTS release. That should be plenty of time to plan and execute an upgrade. Choose the release your team is on, or choose the latest LTS release.
I’ve written up this recommendation, in greater detail, in The Definitive Guide to Clojure on the JVM.
Newsletter Exclusive 🎁
You can read my new guide: The Definitive Guide to Clojure on the JVM. It’s about 20% complete and will likely be around 60 pages. It will cover all of the fundamental JVM things you are likely to encounter when you’re dealing with Clojure, from installing, to interop, to memory management.
The guide was taking longer than I wanted it, so I decided to release it to you, dear readers, in a partial form while I keep working on it. I hope it will be useful to you. Please give me your advice on how to make it better.
Killer Book 📖
I just finished reading The Dream Machine: J.C.R. Licklider and the Revolution that made Computing Personal by M. Mitchell Waldrop. And, oh my, was it a treat. The depth of research is astounding. If you are at all interested in where all of the computing ideas we use today came from—the internet, the mouse, the personal computer, interactive computing, GUIs, and more—the man at the center of it all was Lick.
This book is so perfect in capturing why so much of computing was invented 50 years ago. It was all Lick’s project—to freely fund smart people who shared any of the vision of computing as a means of enhancing human potential through a symbiotic relationship. He was a hands-off sponsor who knew that good ideas take freedom and time to develop. The book also subtly tracks the decline in funding from the Department of Defense into research, which is why we don’t have more today, though you’ll have to ask Alan Kay for more information on the sad state of funding today.
Read this book. The ideas that are obvious today were not so obvious then. This book captures the story of how they became reality.
PurelyFunctional.tv Update 💥
Since Oracle went and changed their licensing, I had to update the JVM Fundamentals for Clojure course. I updated the lesson about choosing a JDK. If you’ve got access, you can watch the updated version now.
Brain skills 😎
A great way to learn something is to teach it to someone else. That will really consolidate your knowledge and force your brain to reorganize the skill. Make a commitment to teach one Clojure topic to someone today. Set a date, learn the skill, and teach them. You’d be amazed how much you can learn when under social pressure.
Clojure Puzzle 🤔
Last week’s puzzle
Last week’s puzzle was to test the Rule of Fives from How to Measure Anything, which states that the median of a population is 93.75% likely to be between the max and the min of a sample of 5.
I only got one answer about this one, from Josh Reighley. I wonder if the problem wasn’t as interesting or if it was too hard. Let me know!
Here’s my solution. I used a basic Monte Carlo simulation technique. My simulation was consistently getting about 93.8% as the answer, which is pretty close to the theoretical 93.75%. I also found that with a sample size of 2, there’s still a 50% chance that the median is between the two numbers, and at a sample size of 3, there is a ~75% chance. Simulation for the win!
This week’s puzzle
Drop every nth element from a sequence
The problem is simple: write a function that takes a number
n and a sequence. The function returns a new sequence with every
nth element removed.
(drop-every 3 [:a :b :c :d :e :f :g]) ;=> (:a :b :d :e :g)
Bonus points for laziness, efficiency, and concision.
As usual, please send me your implementations. I’ll share them all in a future issue unless you ask me not to.
BTW, it won’t be the next issue because I’ll be on vacation and it’s already written! But it will happen, don’t worry 🙂
PurelyFunctional.tv is the most comprehensive Clojure training online. It’s hundreds of pages of guides, 80+ hours of video, and more. Most of the video is available for a fee, and the rest is free. The video gives you a pairing experience—you see me coding and hear me talking out my thought process. You can’t get that with text alone.