Re: How to name variables in a program?



Phlip wrote:
August Karlstrom wrote:


The `=' symbol has been used for ages (and still is)
to denote equality. To use `=' for assignment and `==' for equality is
just downright stupid. Moreover it's something that has to be explained
in every introduction to a language from the C syntax family:

"`x = x + y;' might seem like a strange statement, but..."


There's a world of difference between a software program and a math proof.
(Specifically, the former works closer to reality.)

Explaining that to newbs will help explain why _nothing_ obeys pure math,
not = nor + nor * nor f() nor anything else in a programming language.

Except for side effects, overflow, underflow and the inexact nature of floating point numbers, I'd say that most expressions do have the expected "mathematical" semantics.


You still haven't explained why `i' is not a recommended name for a local variable.

-- August
.