Hacker News new | ask | show | jobs
by shadowmint 3167 days ago
> What are the properties of Clojure that cause programs written in it to have so many bugs?

Well, I can only speak from my own experience, but twice now I've personally seen enthusiastic talent python programmers create clojure projects which 'did all the things':

- used core-async heavily, including blocking channels that are never resolved in the UI.

- massive 'global application state' top level atoms that are mutated arbitrarily throughout the application

- massive complicated one line reduce/map/whatever where people are trying to be clever and reduce the lines of code, because 'fewer lines of code is better'.

I think it's telling when you get a 'walk through' from the person who wrote the code, and they have to stare at it, trying to figure out why it was they needed 10 different channels as they're explaining it.

After thinking about it quite a lot, my conclusion is that I would recommend against clojure for the same reason I would recommend against C: It's easy to mess it up.

Clojure allows you to create very complex applications; and you have all the tools to shoot yourself in the foot.

I don't think I'd tell people to migrate off clojure, but if the opportunity came to work on a new project, I would run away unless at least 50% of the people had actively used it before.

(and by comparison, my experience with a relatively novice team using elixir has been extremely positive; so yes, I do actually think this is a reflection on a clojure itself, not just 'insert any unknown programming language here').

1 comments

You can write bad code using bad practices in any language. All the points you've made have absolutely nothing to do with Clojure, and are simply bad architecture.

Every language allows you to write complex applications, and shoot yourself in the foot. If I pick up Python tomorrow, and start writing a large application in it, it's pretty much guaranteed I'll make a mess.