|
|
|
|
|
by Sahhaese
2536 days ago
|
|
Half the people here are discussing the headline not the article because people don't read articles, they read the headline and jump to the comments. In this case it drowns out discussion of the article because the article is terrible. It doesn't start with the code as it would look like with loops, but instead says "Let's pretend you don't have loops" and then refactors the logic which has nothing to do with loops, then puts the loop back in. The same refactoring would be just as clear with loops, and in fact the version without the refactor might be even more clear. A static function which is only called from a single place isn't always more clear than having the logic inside the loop, especially if all that is left from the original function is the loop. |
|