Emphasize to your students that in languages like Java a semicolon ends a complete thought, rather than just a line of code.

  • Beginner students often assume you must put a semicolon at the end of each line. They might also put a semicolon at the ends of  for loops, conditionals, and method declarations!
    • This is really hard to debug, especially when beginning students don’t know to look for it.
    • Help point this out to students since spending a long time fixing a small syntax problem isn’t a good use of their time.
    • This error can be incredibly frustrating and discouraging for students.
  • Some other languages that include similar syntax are C, C++ and PHP.

More about this tip

External Source

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

Interview with Richard Weiss.