3 ms·
I've been working with Clojure professionally for the past 6 years, and this is completely contrary to my experience. Clojure is the first language I've used w
by yogthos 9y ago
I've been working with Clojure professionally for the past 6 years, and this is completely contrary to my experience.
Clojure is the first language I've used where I'm able to easily read through libraries and understand them.
Clojure uses a small number of common patterns that are applied to solving a wide variety of problems. Most code in the wild that I've seen tends to actually look very similar, and follows common structure.
I've contributed to many Clojure libraries, and many people have contributed to libraries I maintain. My team also maintains Clojure projects that have been in production for years, and we find them much easier to maintain than comparable Java projects we've written previously.
- tigershark 9y agoMaybe you didn't have much experience in programming before learning clojure? I never had any problems in understanding how a library worked in a language that I knew. And I have looked at the source code of quite big libraries in my life.
- yogthos 9y agoI've worked with Java for over a decade in the enterprise before I started using Clojure.
- tigershark 9y agoAnd which Java libraries where so complex that you could not understand them?
- yogthos 9y agoI didn't say I couldn't understand them. I was talking about the amount of time it takes to understand a typical library in a language like Java. My experience is that you would have to spend a lot of time jumping through different classes, and often have to step through things in a debugger to understand them. By contrast, I find that code in Clojure libraries to be much easier to read and understand. You literally needs orders of magnitude less code to solve same kinds of tasks, and it tends to be organized much better. I can open a namespace and read it top to bottom to see what it's doing. That's pretty much never the case with a non-trivial Java class. As a concrete example consider the Java Flyway migrations library to the Clojure migratus library that I've taken over maintaining https://github.com/flyway/flyway/tree/master/flyway-core/src/main/java/org/flywaydb/core https://github.com/flyway/flyway/tree/master/flyway-core/src... https://github.com/yogthos/migratus/tree/master/src/migratus https://github.com/yogthos/migratus/tree/master/src/migratus They both provide same core functionality, and I was able to understand the Clojure version in a few hours. It would take me much longer to understand Flyway or to be meaningfully contribute to it.