|In reply to Comment 218 (Bernie Meyer):|
Oh great - Gregg v. Fabio, Alkis and Bernie; this should be quick...
Actually, I think I've not made my point clearly; I was simply disagreeing with our Anonymous "competent engineer"'s claim that
Jum = Jum + Jump
is less clear than
Jum += Jump
If you want to make an argument out of this, please explain why, in your humble opinion, the latter is clearer than the former.
Nothing to do with correct C syntax or style; I assure you, when I'm obliged to write C, I only use the former structure until I remember the "+=" operator, and then spend precious stress points agonising about whether I should go back and change all my earlier gaffes in case the C fascists start posting my code on ANN...
Since I'm a glutton for punishment, I'll also point out that "+=" is a problem because it is a(nother) superfluous operator (notwithstanding Bernie's elegant argument differentiating "addition" from "incrementation"). See here :
Idiot : How do I add two variables?
Savant : Straightforwardly, c = a + b.
Idiot : Wow, that was easy! Hey, I can save a variable there : a = a + b.
Savant : Ah well, you should really use a better operator there : a += b.
Idiot : Oh. +=. I'll try and remember that.
Savant : Unless b is 1, of course; then you'll want to use that natty ++ operator.
Idiot : I will? Can't I just write a = a + 1?
Savant : Well, only an idiot would do it that way.
Idiot : Right you are.