Hacker News new | ask | show | jobs
by vemv 3096 days ago
Threading macros (-> / ->>) can greatly improve readability, putting lisps on par with Ruby (which I appreciate much).

Best of all, emacs/Cursive lets you trivially transform a sexpr into a threading form, and back. So one doesn't even have to do much effort for refactoring nested (a(b(c(d calls.

1 comments

I totally get that--what I'm saying is that, much like something like C++, you can only practically use the subset everybody you have to work with will agree is acceptable. Threading macros, IMO, help but don't really solve the readability problem, and it's still a far sight from Ruby, but it's a good step. But you have to get Bill the chin-stroking graybeard down the hall to use them when they're "not how he uses Lisp." Contrast this to a language with more guardrails--the equivalent of that threading macro in Ruby (or in Scala, or in F#) is just...The Way You Do It, it's the standard of the tools involved.

You're transforming a linguistic readability issue into a cultural problem of agreement and that's a waaaay harder problem to solve, IMO. Lisps are cool. But every problem raised to "cultural problem" is so much harder to solve. (When was the last time you saw an indent war in Ruby?)

Your observations are on point, and collaborating with lispers is not free of bitter moments.

At work we use cljfmt (similar to gofmt) plus a variety of hacky formatters and conventions. It works for us and I hope to open-source part of our stack at some point!

The experience is similar to that of Rubocop - which btw is the reason why there aren't indent wars (or similar) on Ruby.

Great to decomplect how code is written (however you please), from how it is committed (autoformatted).