Live data from Hacker News

Why Clojure?

gaiwan.co

231–240 of 302 posts

Re: Why Clojure?

#231
post #166

I would have loved to continue working in Clojure but the jobs just aren't there. I spent 2 years trying to get a job and and couldn't even get an interview. 2 weeks of Ruby on Rails searching got me 2 interviews.

Similar experience.

I now think of Clojure as a power tool for small shops and consultants. These aren't the kind of places that typically cast a wide net looking for "employees." Most of the opportunities are maybe more focused on proving that you can bring in business and network effectively enough to be a known quantity in the Clojure community.

Re: Why Clojure?

#232
post #185

Earlier quoted context omitted.

You can keep a JVM running in the background with your project loaded and send stuff there from your IDE/editor. I don't think this is possible with JavaScript.

So they try to make the least-worst JVM environment which is great if you're dead-set on using the JVM, which has a lot of pros. For most people Python/Javascript also does the job and you don't need to learn another paradigm — a Lisp — to code for it, which also makes sense. However, learning a Lisp also makes you a better coder because of immutability and less side-effects. Hence why Clojure is still around.

> For most people Python/Javascript also does the job

True, and people should use whatever works best for them/for the job, no questions asked.

But they also have nowhere near the same experience even though they technically have REPLs. The way a JS/Python dev typically use a REPL is experiment in the REPL itself, then when happy, write the "real code", while a Clojure developers write "real code" all the code, sending selections of code to a REPL in the background, viewing the results in their editor, and just saves the file when they're happy. It might sound similar, but very different experience.

> However, learning a Lisp also makes you a better coder because of immutability and less side-effects. Hence why Clojure is still around.

I don't think "immutability" and "less side-effects" is something lisps in general/all lisps promote/facilitate, it's mostly a thing that Clojure (and children) sticks out for caring a lot about. Scheme/Common Lisp is about as immutable as JavaScript is, and lots of CL programs/code out there spreading mutation all over the place, while in Clojure it's pretty common to just have small "pieces" of mutation in somewhat centralized location.

Re: Why Clojure?

#233

Why Clojure = for Datomic, Rama, Electric and Missionary. No need for long blog post - this stack screams if your app fits within its intended operational margins - e.g. enterprise cloud information systems and rich interactive web products.

As someone who worked with Common Lisp many moons ago, this is the answer I needed to pique my interest in Clojure (again).

Re: Why Clojure?

#234

Earlier quoted context omitted.

Nobody would argue that Java is not statically typed. That's my point. Clojure offers the same as what Java offers. If you write code in a defprotocol everywhere style, as many Clojure libraries do, your code won't compile if you got the types wrong. The same as Java. How's that not static typing? Which part of that is weaker? So what exactly this "Clojure dynamic typing" nonsense is about, I fail to see. Automatical…

That's not quite true though. Java tracks types in the signatures of the functions, defprotocol does not. If I make a protocol and then pass a wrong type as a parameter to it then I'll get a runtime error. It's not going to tell me that I passed in a wrong type at compile time. I find using defprotocol in Clojure tends to be an antipattern because it just makes code harder to read by introducing indirection. The libr…

Then you are not writing in defprotocol everywhere style. The keyword is everywhere. All the domain objects are deftype or defrecord. Try that. It is the same as Java, basically.

It is not an anti pattern, it is the way most low level libraries and clojure itself are written.

Clojure is a tool, not a cult. This core team worship is turning people away. The core team made plenty of mistakes, and got called out, rightfully.

Re: Why Clojure?

#235
Couldn't agree more with the necessity for fast feedback loops. I've experienced the opposite, and it's not fun.

I worked with Clojure/ClojureScript (mostly ClojureScript) for a couple of years many years ago. It was the first time I'd worked professionally with a functional language, so I made a game of minesweeper in my free time to help get to grips with it: https://github.com/robjinman/cljsmines

Back then, I fully bought into the idea that functional language like Clojure were the future, especially on the web. The way application state is managed is perhaps the key virtue of functional programming - if you get it right, you can design your program to consist mostly of completely pure functions. I remember how enlightening that was once I understood it.

Re: Why Clojure?

#236
post #140
post #95

Earlier quoted context omitted.

How to support the creation of beginners might be a different topic (and not a new one to technologies) to the offer of the technology itself. How was your experience in working with the existing Clojure codebase?

Very true. Thanks for noting that. The codebase was democracy-related civic tech software. I was a bit biased against Clojure because I wished for the world to show up in the codebase, but it was written in an uncommon language that scared away most every coder who showed up with curiosity. Probably just the wrong language for the culture I wished to exist around the software. Plus the maintainers used Rich's essays…

I thought of an analogy later, which perhaps colors my experience -- writing democracy software in Clojure felt disappointing, loaded with a power dynamic kinda like the Catholic bible and service being conducted in Latin before the 1960s.

It was not a language "of the people". And not just in how uncommonly known it was, but even the philosophy in how the language governed itself. It felt harmful to me: the cross-pollination between the ethos of the Clojure project (via the well-intentioned developer who brought pieces of Clojure culture into conversations and discussions) and the democracy project.

Re: Why Clojure?

#237
post #93

I've been working in Clojure now for about 12 years. Maybe 12+ years of Java prior to that. I've created some great apps, and great libraries (in both Clojure and Java). I often describe Clojure as "the least worst programming language", which is an off-handed complement, but I think accurate. Things you don't like can generally be fixed (at least locally) using macros and libraries. The core is strong, a good basis…

I gave Clojure a shot some years ago and even wrote an important tool used daily by all employees at our company in Clojure. The problem for me was maintenance. If I had to make any change to that code, I had to dive into the REPL just to understand it. Whereas with something like Java, even if something is poorly written and not documented, I can get at least a minimum understanding of the code just looking at the types.

I've been working on a large modern Java application lately and have never really felt the need for a REPL workflow even after having been exposed to it in Clojure. I tend to structure my Java code so it can be easily unit-testable and then just run the suite of unit tests (several thousand) in a few seconds as needed.

Re: Why Clojure?

#238
Somebody brought up a point about outdated documentation.

Currently https://clojuredocs.org is sort of the go to place. It wins due to Google algorithm.

I wanted to add the ability to vote on answers provided there. So that you have the ability to see the most relevant/popular answer, rather than the oldest.

Raised an issue on the repo, four years ago now. No response:

https://github.com/zk/clojuredocs/issues/222

And why do I mention Google algorithm? Because there was another effort that tried to create a (debatably) nicer documentation, but due to lack of Google traffic, it died. See: https://news.ycombinator.com/item?id=8027119

For a more eloquent argument on its uses, see this blog post:

https://metaredux.com/posts/2019/06/29/farewell-grimoire.htm...

Re: Why Clojure?

#239
post #185

Earlier quoted context omitted.

You can keep a JVM running in the background with your project loaded and send stuff there from your IDE/editor. I don't think this is possible with JavaScript.

So they try to make the least-worst JVM environment which is great if you're dead-set on using the JVM, which has a lot of pros. For most people Python/Javascript also does the job and you don't need to learn another paradigm — a Lisp — to code for it, which also makes sense. However, learning a Lisp also makes you a better coder because of immutability and less side-effects. Hence why Clojure is still around.

I think it's "around" because it's quite productive and sits on a rock-solid runtime with support for an astonishing amount of libraries.

Around these parts it's common to have read and appreciated Paul Graham's old writings about becoming a better software developer through Lisp, and that would be Common Lisp, i.e. very mutable, commonly object oriented.

Re: Why Clojure?

#240

As I skimmed trough the article, the most important pros of Clojure seem to be: REPL, functional language, immutable data, dynamic typing. I wonder what would happen if someone adds a REPL to F#. Sure, it wouldn't have dynamic typing, but isn't static typing good for large code bases? In particular, judging from the article and comments, it seems that the major boon is having an REPL integrated in the IDE, running in…

The main problem with other languages is they are not designed from the ground up to be REPL driven. With Python, for example, it works fine until you have more than one module, then it just falls apart completely. With Lisps like Common Lisp and Clojure you never have to reload the REPL for any reason. You program is running "live". It's really hard to describe, to be honest, you just have to try a true REPL language like (CL is the best, but Clojure is pretty good too).
Post reply on HN