logoalt Hacker News

gleennlast Friday at 9:58 PM0 repliesview on HN

Clojure also has the threading macro -> and ->> which are great at converting exactly the same type of code into a stream of modifications instead of breaking out everything into variables. Naming things can be very useful sometimes but sometimes it is entirely gratuitous and distracting to have

let input = read_input(); let trimmed_input = input.trim(); let trimmed_uppercase_input = trimmed_input.uppercase();

...

The extra variable names are almost completely boilerplate and make it also annoying to reorder things.

In Clojure you can do

(-> (read-input) string/trim string/upcase)

And I find that so much more readable and refactorable.