4 ms·
A few times FizzBuzz appeared on HN, I made this point ... > "Outputting fizzbuzz should be done by executing the (one and only) piece of code that outputs fiz
by Terretta 4y ago
A few times FizzBuzz appeared on HN, I made this point ...
> "Outputting fizzbuzz should be done by executing the (one and only) piece of code that outputs fizz, followed by the (one and only) piece that outputs buzz. That is because fizzing and buzzing are two separate activities – consider the FizzBuzzHissHowl problem, where hiss and howl are printed for multiples of 7 and 11 respectively. The program design of Exhibit A and B would lead to an explosion of code complexity."
... but always got voted off the island in favor of Exhibit A.
Unclear to me why the canonically correct answer examples for various languages are almost universally mistaken as described there, and yet so fiercely defended!
Perhaps Exhibit C is like Fight Club, to be kept hush hush as a shibboleth for sussing out Principal Engineers?