News for hackers. Stuff that matters.
Re:Clever code is probably the worst code you could write by jcelerier on Tuesday May 21, 2024 @08:40PM (#40436074)
> The main operation, addition, is completely hidden magic

the main operation is reduction which is fairly basic computer science and taught in any non-BS curriculum - https://en.wikipedia.org/wiki/Reduction_operator (or https://en.wikipedia.org/wiki/Fold_(higher-order_function) which is the standard way to introduce this concept ; check in particular the table showcasing all the implementations in various languages). The standard reduction for a set of numbers to a number that is likely going to be the very first example in your textbook is addition.

Re:Clever code is probably the worst code you could write by Dylan16807 on Tuesday May 21, 2024 @09:26PM (#40436390)
The reduction is explicit. That's not what the complaint is about. And it's more about implementation than the actual result.

The actual operation is addition. I don't care if it's the first example, that doesn't mean you should hide it.

Imagine if print did hello world by default.