"Agility & Robustness: Clojure spec" by Stuart Halloway
Why Hacker News recommends it
Cited as an argument for runtime specs as an alternative to static typing, including a comparison of types, tests and spec.
What it is
Stuart Halloway shows how Clojure's spec library lets you build programs that are both agile and robust. He covers declarative, predicate-based specification layered on interactive REPL development.
Recommended by 2 HN commenters across 2 different months, 2016 to 2022.
What Hacker News said
Recommends susan_hall · 2016-11 · on “The Unsound Playground: Java and Scala's Type Systems are Unsound”
There have been some fantastic conversations on Hacker News about type systems. I've learned a lot about the different arguments for dynamic typing, versus strict typing, versus gradual typing. Java's type system may or may not have represented new thinking when it was under development in the early 1990s, but it certainly seems a bit dated in the year 2016. The limits of the Java type system have been discussed both here on HackerNews and also elsewhere, many times. For those who want to consider arguments against Java's style of strict typing, 2 things I would recommend include "Agility & Robustness: Clojure spec, by Stuart Halloway": [this video] He offers a chart that shows the strengths and
Recommends Jonovono · 2022-03 · on “Clojure 1.11 is now available”
..... you realise clojure has one of the most powerful ways to 'type' your language? Like 100x more powerful than the typescript or whatever type language you are using now ;p [this video]
Cites lkrubner · 2017-01 · on “Making the move from Scala to Go”
Since they cite me (and my essay from 2014) as part of their decision making process, I want to throw in 2 cents here. They ended up deciding on Go, whereas I have ended up preferring Clojure, yet I agree with a lot of what they say, so I'll try to clarify why I ended up with a different decision than what they made. I understand what they mean when they write: I think the first time I appreciated the positive aspects of having a strong type system was with Scala. Personally, coming from a myriad of PHP silent errors and whimsical behavior, it felt quite empowering to have the confidence that, supported by type-checking and a few well-thought-out tests, my code was doing what it was meant to