Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur...
by vips7L on Saturday October 07, 2023 @08:23AM
(#37801115)
I personally find let, also, and friends to be a clarity nightmare. For me, they make reading code harder.
Re:Java 21 VirtualThreads vs. Clojure Lazy Seqs (from Clojur...
by usrusr on Saturday October 07, 2023 @10:14AM
(#37801872)
It's not always better, I give you that. If something does not work as expected you might even find me transforming code to conventional imperative style. But I feel like I have a much better shot at getting it right in the expression chain style, and in all styles if scopes are not polluted by dubious intermediaries and/or badly named one-callsite functions thanks to letisms. By the time the "let tax" grows too high, chances are that the block in question is big enough to make the "factored into a function tax" bearable.
Tying down a value to a name only if you have something meaningful to say in the name, and only when the value is actually finished instead of being a work in progress, that gives me great piece of mind and frees up mental resources for other things. I wish every language had a "kotlinized" sibling that simply added the scope functions on syntax level (or a subset of the scope functions, not sure you need a zoo that size)