Hacker News new | ask | show | jobs
by fredrikholm 1354 days ago
Greenspun's tenth rule, adopted for 2022:

  > Any sufficiently complicated TypeScript or Java program contains an ad hoc,
  > informally-specified, bug-ridden, slow implementation of half of Clojure.
Once you grokk the approach and workflow Clojure takes in solving problems, the distance between having an idea and writing a rock solid implementation of that idea is the shortest I've experienced in my ~20 years of programming.

If you want to write succinct, transparent code whilst minimizing the future potential of introducing bugs, Clojure is as good as it gets.

2 comments

Cute, but i'll counter with this one:

> Any sufficiently complicated Clojure program contains an ad hoc, > informally-specified, bug-ridden, slow implementation of half of Spring.

Ah, Spring - freeing Java developers from the horror of typing "new" since 2002.
If you did a Spring tutorial, I can see that this might be the takeaway. For me, I was thrown at a large project with a couple of large Spring codebases, I concluded that it's about structuring your code around an object graph with independent, testable, loosely coupled components.
I use both Spring and Java professionally. For a pretty long time now. I was being somewhat sarcastic.

I mostly use Spring because it's pretty widespread and I figure - why fight the current. But I still think the benefit is minor for most projects. And the existence of Spring Boot makes me chuckle a bit.

I get you. I think it encourages a certain application structure that is at least recognizable across projects. There's a pretty big benefit to that, even if at the detail level it's just a way to avoid new.
Including Spring itself?

Jokes aside, can't Clojure simply call whatever you want from the JVM?

Maybe theoretically true (I'm not sure about the extent of the completeness), but definitely not practically true when it comes to annotation-driven-development frameworks such as Spring.
Ah. While objects have their uses, I think the Clojurist might prefer, well, closures. That's not to say one is better than the other, just that the Clojurist probably won't miss the style of the Spring framework.
But it doesn't have reader macros!