5 ms·
Every time Clojure comes up on HN there always seems to be a lot of negativity. I've come to flinch just seeing a mention of the language, which I do still love
by thom 6y ago
Every time Clojure comes up on HN there always seems to be a lot of negativity. I've come to flinch just seeing a mention of the language, which I do still love and have used for a decade, but perhaps this is how everyone feels about their pet language. I think there's a bit of a tension with Clojure, that it's a weird combination of being principled and being pragmatic, which means that there are always languages that on paper beat it out on any given axis. At the same time Clojure people do have a tendency to paper over the cracks quite a lot, at least some of which must be cognitive dissonance.
The biggest problem is that it's very hard to picture why, at the end of the day, all the choices that went into Clojure come together into a productive whole for building real-world software. It's a really nice mix of terseness without preventing clarity, simple lightweight modelling paradigms, interactive development, easy access to multiple cores, and all on top of the JVM with its enormous ecosystem. It's not as Lispy as other Lisps. It's not as pure as other functional languages. It doesn't have a fancy type system. It doesn't have native performance. But it gets stuff done and it does so fairly elegantly in most cases. I've found it a really solid career choice, there's really very little that you can't solve in a satisfying way. Plus whatever you think about parentheses, Clojure syntax basically hasn't changed in 10 years, most new features are just libraries of new functions and macros, and for me that validates that it's the correct approach.
- cageface 6y agoThe problem with lisp is that most programmers find the syntax extremely off putting. I've been watching this debate go around and around in circles for 20 years now and nothing has changed. And as much as I appreciate the power of macros I feel like the features of other modern languages cover a lot of the same ground so the benefits of such a controversial syntax are diminished. Lisp is a fascinating and very elegant language and every developer can learn something from it but I gave up waiting for the lisp revolution a while ago.
- cageface 6y agoThe other problem with Lisp is that it attracts a fanatical element that rejects any criticsm of the language. Every language has its zealots but Lisp takes it a step further. Google Erik Naggum for an extreme example of this syndrome.
- deleted 6y ago[deleted]
- thom 6y agoYeah I just think when a language never has to go back and invent new syntax and junk to keep up, it’s probably doing something right.
- cageface 6y agoLisp got a lot of things right and modern languages have borrowed a lot of ideas that were pioneered in various Lisps. But nobody has borrowed s-expression syntax and I don't think that's an accident.
- samth 6y agoI don't think that's true -- we're discussing a language that was invented relatively recently and has sexpressions. It's just that if a language has lots of parentheses, it gets classified as a lisp.
- john-shaffer 6y agoAs soon as a language borrows s-expressions, it's a Lisp. This makes it impossible in practice for a non-Lisp to just "borrow" s-expressions. Definitely not an accident. On the other hand, you do have languages like XML which is basically a much more cumbersome syntax for s-expressions.
- kamaal 6y ago>>The problem with lisp is that most programmers find the syntax extremely off putting. For all practical purposes Lisp doesn't even have a syntax. The real issue is with programmers who are at beginner and advanced beginner levels all life. This problem existed with Perl too. Agreed that a lot of text manipulation tasks that existed before the data exchange standards like JSON and XML came around don't exist anymore. The use cases for Perl have reduced. But the overall point stands of course. People are willing to write 100 classes to extract a string from data, than learn to write 10 lines of regex code. If the only thing you are willing to learn and use is a for loop, if statement and function/class syntax. Anything will look off putting. Just see how many programmers struggle with concepts like concurrency, pointers, recursion etc. It's just that these people struggle to hold non-trivial concepts in mind.
- cageface 6y agoThere's an elitism inherent in this take that I think is misplaced. A lot of programmers are perfectly capable of weighing the pros and cons of s-expression syntax and deciding it's not for them. Too many Lisp programmers believe that Lisp way is the right way and not just a set of tradeoffs like every other language design.
- yw3410 6y agoOnly a relatively few amount of programmers have programmed in non-Algol syntax in-anger, rather than the reverse. How can you weigh up the pro or con of a syntax when you haven't used it much? I couldn't tell you whether APL syntax was any good.
- Kalium 6y ago> At the same time Clojure people do have a tendency to paper over the cracks quite a lot, at least some of which must be cognitive dissonance. An executive I previously worked with commented one day "Every small language's following is a little bit cult-y. Clojure's is more so than most." Personally, I think the technology itself is fine. The ecosystem, from my exposure to it, has a few warts. It's somewhat small, which I expect of what is still a niche language. The killer issue for me was the memes that slowed and discouraged the development of useful frameworks in favor of gluing together ad-hoc sets of libraries. Of course, it may have just been that I was working with a batch of Clojure devs who were in those jobs because they were sold on the glories of functional programming purity. Hard to say. They were better than the Haskell shop I worked in, but not as much so as I would have liked.
- thom 6y agoCan’t argue with this, I find it immensely frustrating. I’m on my fifth or sixth library for interacting with a database, my third component library, fourth or fifth config library, and the data science story especially has always been terrible because of the aversion to frameworks. This isn’t necessarily a great hardship, and for the most part old code just works, but so many libraries fall by the wayside or just never reach their potential cos they were the singular vision of one smart person, while all the other smart people were off working on other stuff.
- Kalium 6y agoIt became a major headache for me when I saw multiple teams of developers trip over the same blind spots. Gluing together libraries works best when you're enough of a domain expert to understand every aspect. When you're writing public-facing web services and forget about security while pulling together your stack, this ignorance can become very dangerous!
- mumblemumble 6y agoI've never been a huge fan of lispy syntax, but I've never been a big hater, either. Personally, I find the square brackets and curly braces to be just enough additional texture to make the code plenty readable, as long as you're using a good autoformatter. (Letting people make their own decisions about code formatting in any lisp seems to be a very quick route to a very bad time.) What I find, though, which makes me sad, is that many people knee-jerk reject any non-ALGOL syntax (Lisp, but also Smalltalk, ML, Prolog, whatever). To the point that I fear that not being able to understand the syntax becomes a point of pride. It reminds me a bit of the sort of asymmetrical intelligibility of Metropolitan French and any of the Canadian dialects, a situation where I also get the impression that the difficulty in understanding is more than a little bit deliberate. So there's that. But I also do find that Clojurists have not been immune to some of the snootiness that seems to infect most functional language communities. And I wonder if some of the reaction comes from that, combined with Clojure maybe bumping into the rest of the world more often due to its identity as a JVM language.
- thom 6y agoYeah I do see this attitude and it’s sad, I guess it’s hard to create a new language on an existing runtime and not try to market it (and convince yourself) that it’s better than the alternatives, but no doubt it goes further than that. Which is a shame because again, I think Clojure is good because it’s fairly pragmatic. It feels to me much more a product of software engineering knowledge than computer science knowledge (despite fancy and useful theoretical stuff like transducers, which of course exist in many places now).
- mumblemumble 6y agoI'm inclined to agree. For me, Clojure feels like the one alternative JVM language that really offers a more-than-merely-incremental productivity boost over Java for a lot of everyday problems. (Scala also has its strong spots, but I find them to be fewer and further between.) And also, conveniently, it lets you really easily switch to Java for the bits that Java does better. It's maybe the quintessential Cassandra language, though. As a dynamic functional language, Clojure is a great complement to Java. And, while I've also never really been comfortable with macro programming, compared to Java's accumulated decades' worth of XML and code generation and bytecode munging and and dependency graphs that have been sent through a wood chipper by annotations, s-expressions and macros strike me as a delightfully clean and maintanable-looking breath of fresh air. But all that stuff also makes it a bit of a tough sell among the kinds of folks who haven't long since abandoned Java for a language like Ruby or Python. A bit like trying to sell tie-dyed shirts out of a VW bus at a Barbara Streisand concert.
- causality0 6y agoEvery time Clojure comes up on HN there always seems to be a lot of negativity. Frankly I'm just sick of hearing "Why you should use Clojure" over and over again. Posts about other languages center on some problem that language solved for them, or some problem they have with it. Clojure posts are always cold-call cheerleading about how good it is in a general sense. Tell me something cool you did with it. Tell me how it saved you a mind-blowing amount of work. I'm not interested in hearing for the Nth time how someone think it's an overall excellent choice.
- tincholio 6y agoAt my previous job, I implemented a stream processing solution in Clojure, which superseded a Java one which never had quite worked (it was a pretty bad codebase, in fairness), added more complex functionality, and allowed me to drop 1/3rd of the code in that module (from 18KSLOC to 6KSLOC). More importantly, it worked as intended, and only a couple of negligible bugs made it to production, which for the complexity of the system, and the scarcity of QA we had, was surprisingly good, tbh.
- bitwize 6y agoWhen I mentally diff Clojure against other JVM-based Lisps -- mainly thinking of Kawa and ABCL here, which are dialects of long-established Lisps -- Clojure comes up different enough to be weird, but not sufficiently better than the alternatives for me to put up with the weirdness and choose it over them. It's kind of like when I recently evaluated Visual Studio Code (for the (1+ n)th time) to use as my default editor. Everybody I know at work uses it, and for a couple years there Hackernews made a collective O-face every time a new version dropped from Microsoft. So it must be good, right? Well, it was different enough from Emacs to force me to get used to an entirely different workflow, but not enough better than Emacs (really, for my purposes, not better at all) to justify making that enormous transition. So back to Emacs I trudge. A reasonable person may make the same call about transitioning from Visual Studio Code to Emacs when they hear advocacy from Emacs users like me. That's where Clojure is for me -- in this limbo of it sounds good but it's not really worth it for me, personally, to switch. Plus its community has a strong contingent of douchey advocates -- not quite at the level of say, Rust or Newlisp but getting up there -- who act like Rich Hickey was God's gift to programming and make me think "So that's what Smug Lisp Weenies sound like to the rest of the world." And that further cements me in the realm of "hard pass" w.r.t. Clojure. Call it an irrational, emotion-based response.
- deleted 6y ago[deleted]
- thom 6y agoTo be honest I don’t really believe any programming language is that big of a boost in the real world, outside of certain hard requirements for correctness or performance. Ironically if I were to want to make another 10-20 year bet on a language it would be Rust so perhaps I’m drawn to douchebaggery, but I’m sorry that’s your experience of Clojure.
- kamaal 6y ago>>not enough better than Emacs (really, for my purposes, not better at all) to justify making that enormous transition. So tell us what your workflow is, so that everyone can benefit from it. It doesn't do much good in just saying Its magic, trust me and then leave it there.