>I fail to see how i = i + 1 is not obvious to only
but the most
>simple-minded of people :)
On Mon, 15 Aug 2005, John Foust wrote:
It's not algebra, so that'll confuse anyone
who thought that
computer languages might be mathematical. Huw's criticism is
valid to the well-trained eye. It's an idiom that's evolved,
based on the common operation of calculating a value based on
a stored value and then tossing it back in a location.
It certainly is NOT algebra!
In algebra,
N = 0
N = N + 1
would be an inductive proof that all integers are equal.
That would cause an immediate cessation of the universe as we know it
(and replacement with something even weirder?)
Therefore, NEVER show that to a mathematician.
The difference between equality and assignment can be a tough one for
beginning programmers to master. It would make life easier to use the
left arrow, as APL does, instead of the "equals sign" for assignment.
... or the N := N + 1, or MOV N, N + 1 , or even the LET N = N + 1 ,
as used by Kurtz and Kemeny in their early versions of BASIC.