Collective memory
Richie Hindle
richie at entrian.com
Fri Jul 11 03:47:49 EDT 2003
[Charles]
> y = x/*p;
>
> is quite different from:
>
> y = x / *p;
>
> The first way, "/*" will begin a comment...the second way,
> you get the integer "x" divided by the integer pointed to by "p".
[Walter]
> Ouch!! That is one reason code coloring is *important*.
<aol>Me too.</aol> In the (not too distant) days when syntax colouring
was rare and C would quietly declare undeclared variables as 32-bit
integers, we lost several man days to a piece of code like this:
void function()
{
short x; /* Some X thing /*
short y; /* Some Y thing */
functionExpectingPointersToShorts(&x, &y);
}
Dragging us back on topic, this is why languages should only have
single-line comments, and shouldn't let you reference variables before
they're defined.
--
Richie Hindle
richie at entrian.com
More information about the Python-list
mailing list