Lay out what good programming style consists of for your class to encourage good style and make debugging easier.

Like(470 Likes)
  • Explain why good style is important to your students. For instance, good style:
    • ensures there is no confusion when grading assignments.
    • improves readability of code, so it will save them a lot of time in the long run 
    • prevents bugs and makes it easier to debug.
      • It is not just meant to make the code look nice.
  • Good style practices include:
    • Proper Indentation and position of curly braces
    • Descriptive names for classes, methods and variables
    • Initializing variables and using named constants
    • Structured commenting.
    • Strategic use of white space.
    • Breaking up code into smaller, logical chunks.
  • Students should be coding with good style throughout the programming process, not simply implementing good style after the fact.