Saturday, August 24, 2013

Java - The importance of syntax highlighting

Q: What's wrong with this code?

while( true);
{
  System.out.println("Hello Dave");
}


A: It only runs once.


while( true);
{
  System.out.println("Hello Dave");
}

The semicolon ends the block, so the subsequent block in curly braces only runs once.  All the more reason to change your font and colors to accentuate symbols so they're harder to miss.  I'm old school and have a black background with all my symbols in bright red.

No comments:

Post a Comment