Hacker News new | ask | show | jobs
by trealira 986 days ago
In languages without this feature (most of them), you sometimes see long blocks get labeled at the end anyway. On the other hand, you could argue that if your block is long enough it doesn't fit on the screen, then it should be its own function anyway.

Like this, except replace "..." with many lines of code.

  if (z.p == z.p.p.left) {

      ...

  } else { // z.p != z.p.p.left

      ...

  } // if
1 comments

> In languages without this feature (most of them), you sometimes see long blocks get labeled at the end anyway.

True. However, in Ada at least, if the block types don't match then it's a syntax error detected at compile time by the compiler. Comments like those listed above are often not checked at compile time, and thus aren't very useful for preventing errors.