Thursday, August 4, 2011

Semicolon cancer

You know that in many programming languages semicolon indicate the end of a line but not everybody knows that imposition of this requirement is more related to hardware than software. Early programming languages were line-oriented. In FORTRAN, for example, various parts of the statement had specific columns or fields that they had to appear in. Since some statements were too long for one line, the "continuation card" mechanism wasprovided to let the compiler know that a given card was stillpart of the previous line. The mechanism survives to this day, even though punched cards are now things of the distant past.