Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Ensure loops and conditionals are consistently formatted.

  • This will help students to understand the basics of each loop and conditional statement.
  • It will also help students avoid unnecessary refactoring of code later on.

More about this tip

Tags

  • Programming Concepts
External Source

“The ugliest beautiful line of code” (blog post) by Neil Brown

Other Tips By
Other Tips By Neil Brown

Similar tips

Misconception: Students believe that in a primitive assignment, x = y could be the equivalent of y = x; they think that the computer science “=” sign is the same as the mathematical “=” sign.
Misconception: With conditionals, students may try to compare the memory address of a function to a number, like x < foo, when they intended to compare x with the return value of foo.
Explicitly discuss the lack of bounds-checking in C-based courses to avoid student confusion when using strings and arrays.

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Powered by Drupal.

Privacy Policy