Thursday, June 13, 2019

Format Your Programs

Consistency is key.

The understandability of a program is greatly enhanced by using standard indentation protocols. Which protocol you choose to follow matters little, but, once you select it, use it consistently.

The only thing worse than inconsistent indentations is incorrect indentation (such as, aligning an ELSE with the wrong IF)! To prevent accidental misalignments, use a pretty printer.


Reference:
McConnell, S., Code Complete, Redmond, WA: Microsoft Press, 1993.