8 thoughts on “PHP FizzBuzz Test”

  1. Just to one up the previous comment. You could of course write it like this,
    but who would understand it?

    There is a deliberate bug in the code, can you fix it?

    The true secret to any algorithm is not to write it as small as possible, but clear enough for your maintenance team to understand and debug!

  2. We could go one better with

    However, there is a small bug in the above code. Can you see what it is?

    The secret to writing great algorithms isn’t about writing the least amount of code, but rather about writing easy to understand and debug. You have to consider the maintenance teams that will be fixing your code once you’re gone

Leave a Reply

Your email address will not be published. Required fields are marked *