C's syntax
jurgen.defurne at philips.com
jurgen.defurne at philips.com
Wed Oct 25 07:06:43 EDT 2000
Historically, two languages have been defined by people who were probably
more mathematicians. The first one is COBOL, the second one Pascal.
Since mathematically '=' means 'is equal to', they found it more appropriate
to use '=' for it's real meaning, and create new operators for assignment:
Pascal : A := 0;
COBOL: MOVE 0 TO A.
Jurgen.
sandj.williams at gte.net@SMTP at python.org on 25/10/2000 05:47:23
Please respond to sandj.williams at gte.net@SMTP
Sent by: python-list-admin at python.org
To: python-list at python.org@SMTP
cc:
Subject: Re: C's syntax
Classification:
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.
--
http://www.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list