Re:Dr. Software: An unfinished journey starting from dirty c...
by divs1210 on Wednesday June 30, 2021 @11:29AM
(#27689728)
Both are functional styles.
(defn foo01 [a]
(let [b (x a)
c (y b)
r (z b c)]
r))
and (defn foo02 [a]
(z (x a)
(y (x a))))
are both valid.I prefer the first one where I can see the intermediate steps clearly.
It's also easier to read the first style. It's more like a bulleted list:
The functional style is often an awkward horizontal string of chained steps. Sure, the formatting can be adjusted, but it takes more effort, training, and/or discipline to format functional code to make it legible to ordinary code maintainers. Procedural just handles riff-raff better; functional requires ideal conditions/staff.PS, do I really deserve a -4 score above?