13 ms·
Clojure really brings out the negativity in a lot of people. I love the language and the ecosystem and it's done wonders for my career. Is it perfect? No. There
by jakebasile 4y ago
Clojure really brings out the negativity in a lot of people. I love the language and the ecosystem and it's done wonders for my career. Is it perfect? No. There are definitely warts. But whenever Clojure is brought up I tend to see a lot of the same criticisms. I feel compelled to defend the honor of my favorite language, so here's my perspective on a couple of the perennial issues people bring up. This doesn't mean that if you think these things you're wrong, but this is my perspective having used Clojure for a long time.
Startup times are a non issue. Does the fact your server takes a few extra seconds to start on deploy actually matter? No, it doesn't. In development I hardly restart my REPL unless I update a dependency or pull from a branch. Even in the latter case I can usually use Cider to refresh it. In my 8 years of writing Clojure that other people give me money for I can confidently say it's never been a big issue.
I love that it runs on the JVM and doesn't hide it. There's infinite libraries for every weird enterprise B2B widget so I don't have to screw around (much) to get them to work. The JVM is a great tool and runs on anything.
Types. Everyone always hand wrings about types because they don't understand how anyone could possibly refactor the huge data structures they're used to from OOP without types. It's also, largely, a non issue. For one, data structures are not the abstraction in functional programming. Functions are. You don't need to write class OtherCompanyAccountsGetter, you just write a function that maybe takes a couple parameters and returns the accounts. You then test that function. Then you build more functions on top of it. If the underlying API changes you go change that one function and make sure your tests still pass. If something drastically changes about inputs you can easily find all usages and fix things up. Additionally, in my experience, FP leads to systems that need far less big time refactoring than OOP, since things are encouraged to be broken up into much smaller pieces (functions) and those pieces are meant to be black boxes. The worst Clojure codebase I've worked in was far easier to understand than the worst OOP codebase I've worked in.
- mountainriver 4y agoTypes are pretty useful outside of OOP for catching a bunch of runtime errors and serving as documentation to help understand the code. I haven’t written a ton of clojure but every large untyped code base I’ve seen is a mess, and usually there are people around it claiming it’s not
- kelseyfrog 4y agoHow much spec are you using?