C's syntax
Steve Williams
sandj.williams at gte.net
Tue Oct 24 23:34:34 EDT 2000
Andrew Dalke wrote:
> Erik Max Francis wrote:
> >[Writing "0 == a" instead of "a == 0" to catch accidental typos of
> >"=" instead of "=="] is largely unnecessary. It is a novice programming
> > error, one that actual programmers do not make unless they are very green.
>
> I accidentally typed "=" instead of "==" today, in Python code expecting
> an expression. I was glad to get the exception. Oh, and I've been coding
> for 17+ years and professionally for 5 of those, so I'm not very green.
>
[snip]
Of course in COBOL you can write
If a = 1 . . .
as well as
if a = 1 or 2 or 3 . . .
and even
if a not equal 1 and 2 and 3 . . .
In COBOL, only a novice would write
if a == 1
and the compiler would definitely sneer at him.
But then COBOL's an antique, verbose language.
More information about the Python-list
mailing list