Bugs can be code styling errors

I just found this while debugging an issue:

if ( isConfigured() ) 
    if ( isAllowed() ) 
        doTask(); 
else 
    noConfigurationIssue(); 

I can’t tell you how many times I looked at that before I saw where the problem was. My brain was so used to following styling hints to see control of flow that it didn’t notice that the actual true flow was different from the visual flow. @*&^!

1 thought on “Bugs can be code styling errors

  1. Dev

    That’s why you should always use blocks ({}), even for a single line of code.

    It’s worth the screen estate!

Comments are closed.