Re: How to name variables in a program?



Phlip wrote:
And don't get me started about :=.

Ok, you brought it up. What we really want is a left arrow. Unfortunately it's neither available in the basic ASCII set nor on standard keyboards. 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..."

....and we shouldn't mention the perfectly valid c statement

   if (x = 0) ...

> You must type two characters for the most
common form of equalization (assignment)...

This is a silly argument.

Also don't use i. Just because everyone else does it doesn't make it right.

What's wrong with `i' as a local variable?

- use camelCase for methods

This is standard in Java. Other languages has other conventions.


"standard"? The Java hook is the language started recently, from a single
source, and spread rapidly, conveying the style of its progenitors.

Not sure of what you mean.

-- August
.