Re:No Stinking Loops
by d0mine on Saturday December 16, 2023 @02:31PM
(#38667023)
Loops themselves can be considered just convenient wrappers around goto. The point is to restrict the variety (structured programming) and make spaghetti unreadable code less likely.
Using higher-order functions instead of loops is similar e.g. loops:
# input_ = "1,2,3"
numbers = (int(d) for d in input_.split(","))
product = 1
for n in numbers:
product *= n
Using higher-order functions instead of loops is similar e.g. loops:
can be replaced: