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

Encourage students to get the for-loop counter right before adding code inside the for loop this will reduce the amount of time spent troubleshooting for-loops and ensure students are scaffolded well.
Have students practice looping through an array in as many ways as possible, such as forwards and backwards, to increase their comfort with array looping.
Create boolean variables to use as the condition when introducing if statement to highlight for students that the condition is any expression that evaluates to true or false.

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

Privacy Policy