News for hackers. Stuff that matters.
Re:Why Structure and Interpretation of Computer Programs Mat... by wongarsu on Sunday June 16, 2024 @09:10PM (#40701448)
I'd argue a FP implemenation with map (something like `[99..1].map(|n| f'{n} bottles of beer ... {n-1} bottles of beer on the wall').join('\n\n')`) is inherently as readable as the for loop, and not really more complex.

There are lots of great parts in FP, and for the last ~10-15 years imperative programming languages have made a lot of effort to add them to their syntax. You just need to leave out the more dogmatic parts that make FP popular in academia.

Re:Why Structure and Interpretation of Computer Programs Mat... by troad on Sunday June 16, 2024 @10:10PM (#40701734)
Hehe, it's easy if you ignore half the song, the singular for n=1 and the whole n=0 case! (Not that we're talking about rocket science if you don't, but c'mon, oranges to oranges!)

I agree with you otherwise though.