Bob Ammerman wrote: >> Yes, it's standard C/C++ notation, but it's not "natural" and perhaps >> that >> is the reason why most other languages don't let you do it. > > I find the C/C++ concept/notation very natural. > > If I ask you to add 3 to a total, do you think in terms of: > > Total = Total + 3 > > or > > Total += 3 > > I submit that most people think (in English at least) more like the second > than the first. The second one reads as "total plus equals three", which is nonsense. So far I like Olin's suggestion to use an arrow the best: Total + 3 -> Total ..which would read as "total plus three, store result in total". TI-89's BASIC does it this way (they actually use an arrow character). Although when I first got into programming (which was some time *after* dinosaurs became extinct ;-P ), a statement in Commodore BASIC: X = X + 1 ..made total sense to me. I was 14 years old, spoke very little English, had zero prior experience with programming and nobody around able to help. I don't want to leave the impression that I find +=, &=, and the like difficult, but when I first stumbled across them, they did seem rather odd. One more time for the record: I don't feel strongly about this issue (not nearly as strong as I feel about self documenting code vs line-by-line comments). > Also, in favor of the C/C++ way, what about something like: > > > board_array[ nKingsColumn, iPawnRank ] = board_array[ nKingsColumn, > iPawnRank ] + 3; > > vs. > > board_array[ nKingsColumn, iPawnRank ] += 3; > > when the subscripts get messy the C/C++ way makes it very clear what you > are > trying to do. I'm not sure exactly what you're doing with this array, but I think in this case I would use another variable to store the intermediate result. And I probably wouldn't use a "magic number". It begs the question, "Why 3?". And then of course you _have to_ have a comment to explain what the statement does -- a self-fulfilling profecy. > and if the subscript involves side affects (function call, n++ or > whatever) > you really have to do it the C/C++ way: > > myArray[determine_subscript()] += computed_value(); Ouch! :( This is the kind of code I would expect from a programmer who codes for "job security". Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist