Live data from Hacker News

Clojure is cool

ahungry.com

41–50 of 133 posts

Re: Clojure is cool

#41
post #30

Earlier quoted context omitted.

Except nobody actually writes Java code like this. Nobody implements the Map interface. It's just stupid code. The myth of Java bloat only serves people writing silly blog entries and others hung up on "best practices" from 15 years ago. It doesn't seem to have any practical basis.

There are places stuck with Java 6 or 7. Java 8 is still relatively recent for the Enterprise world. Java 8 was a special version. Lambdas, stream API, diamond operator and new exception catching syntax together eliminated 50-80% of noise in Java code. The language is still verbose, but much less than pre-8. (Still, I prefer reading Clojure. The form of Java language still causes too much structural noise in the code…

> Java 8 is still relatively recent for the Enterprise world.

Most actual surveys put Java 8 penetration at 70 - 80%. Dig deeper and the This is what makes the entire exercise a myth. People may want to believe this stuff but again it has no practical basis.

Re: Clojure is cool

#42

Every few weeks I see a Clojure post on HN, and almost always there's a battle going on in the comments over whether the language is too clever, impractical, a toy, poorly designed, etc. My experience with clojure (a ~1500 loc library) has been quite good. I won't say it's intuitive for those coming from imperative/OO backgrounds, but when it clicked it really clicked. If a team decides to invest the time to learn cl…

Code-sharing between ClojureScript and Clojure is a killer app

Re: Clojure is cool

#44
post #41

Earlier quoted context omitted.

There are places stuck with Java 6 or 7. Java 8 is still relatively recent for the Enterprise world. Java 8 was a special version. Lambdas, stream API, diamond operator and new exception catching syntax together eliminated 50-80% of noise in Java code. The language is still verbose, but much less than pre-8. (Still, I prefer reading Clojure. The form of Java language still causes too much structural noise in the code…

> Java 8 is still relatively recent for the Enterprise world. Most actual surveys put Java 8 penetration at 70 - 80%. Dig deeper and the This is what makes the entire exercise a myth. People may want to believe this stuff but again it has no practical basis.

Yep, like Java 1.4 running on Red-Hat Linux 5 deployments, where no one is allowed to touch beyond bug fixes and security updates.

Re: Clojure is cool

#45
Clojurescript has been the real hero for me coming from a heavy Javascript background. The UI patterns are basically 1:1 with the functional standards in Javascript land, but you're working with a language that has immutable data structures by default (I can ditch Immutable.js) and the core library has all those goody functional helpers I'd include ramda or lodash for.

But in addition to that, shadow-cljs is truly incredible, kudos to Thomas Heller. When developing, my editor is connected to the browser app through a repl, and I can switch namespaces and sort of TDD new code, or debug an issue by cracking into the actual pipeline and interactively spelunking. In JS land, everything is transpiled, so really you have to put debuggers, refresh the page or action, catch the debugger, and do stuff that way. If you're developing new code you can't test out a function if it uses some transpiled feature, so you write a test or do the debugger thing.

It's takes some dedication to get there, and you don't need emacs even though it's really fun to learn and get proficient in. I use Spacemacs and am constantly learning some new package that's installed to help me. I recently switched from parinfer to paredit, and it's reaalllllly cool. With the repl driven development and structural editing you can achieve this kinda mind-meld with your development process. I don't think that necessarily makes this better than Javascript, but if you're into stuff like that there's a really high skill-cap with how you can optimize your development workflow.

And really, at it's core to me Clojurescript is like my perfect Javascript. There were not any new concepts for me to learn as I had been programming Javascript functionally for some time, it's just everything I wanted in Javascript without the friction and bolt-on libraries.

For developer happiness, it has a ton to offer, and there's always something else to dig in to.

Re: Clojure is cool

#46
Clojure is something I have been wanting to experiment with, but not having types makes it very difficult for me to reason while coding. It's just me. I am used to thinking in types.

Re: Clojure is cool

#47

Earlier quoted context omitted.

Literally interviewed at a company that is doing the same thing. B series, clojure/scala codebase, moving away to Elixir Phoenix.

Seems pretty weird to suggest that if juniors are struggling with one niche language, moving to another would ever be the solution.

Fashion driven development.

Re: Clojure is cool

#48
post #29
post #26

Earlier quoted context omitted.

Studies have found that bug count is roughly proportional to program length, across languages. Saying you prefer verbosity essentially means you prefer more bugs. 500 lines is generally less understandable than 40 lines. There may be cases where terseness can be too extreme, but I don't see it here. Is there some particular aspect of the Clojure code here that you think is overly clever, or hard to understand? This C…

can you link the studies? I'm genuinely interested

Here are a few which are relevant:

"Code Review Metrics". [0]

"A Large-Scale Study of Programming Languages and Code Quality in Github". [1]

"Software Quality Metrics". [2]

"Study on the Correlations Between Program Metrics and Defect Rate by a Controlled Experiment". [3]

0 - https://www.owasp.org/index.php/Code_Review_Metrics

1 - https://cacm.acm.org/magazines/2017/10/221326-a-large-scale-...

2 - https://www.developer.com/tech/article.php/10923_3644656_2/S...

3 - https://scialert.net/fulltext/?doi=jse.2013.114.120

Re: Clojure is cool

#50
post #28
post #26

Earlier quoted context omitted.

Studies have found that bug count is roughly proportional to program length, across languages. Saying you prefer verbosity essentially means you prefer more bugs. 500 lines is generally less understandable than 40 lines. There may be cases where terseness can be too extreme, but I don't see it here. Is there some particular aspect of the Clojure code here that you think is overly clever, or hard to understand? This C…

It would be wonderful if anyone commenting on HN with “studies have found...” would accompany their comment with links to said studies :)

Just did a moment ago in this thread:

https://news.ycombinator.com/item?id=17946568

Post reply on HN