Whats the name of this operator "+=" ?
+1 this isn't the name, but if you say it 99% of programmers will know what you're talking about. Language is about communication, not about perfection.
Chris Lutz
2010-01-21 06:44:28
Ya. +1 for being honest but wrong :)
George Edison
2010-01-21 07:26:28
+1 - that's what I've caled it and I don't think I can remember working with anyone who habitually called it anything else.
ConcernedOfTunbridgeWells
2010-01-21 07:26:55
+17
A:
It, along with -=
, *=
, etc., are called the augmented assignment operators in Python, and "compound assignment" operators everywhere else.
Ignacio Vazquez-Abrams
2010-01-21 06:39:12
Twaddle, the word augment, in all its variations, is mentioned exactly three times in the latest C++ draft standard and not at all in reference to +=. They're simply operators, that's all, it doesn't have a special name. You should base your information on something a little better than an orphaned Wikipedia entry :-)
paxdiablo
2010-01-21 07:13:18
@paxdiablo: http://docs.python.org/reference/simple_stmts.html#augmented-assignment-statements
Ignacio Vazquez-Abrams
2010-01-21 07:20:03
I stand corrected: coming from a C background, the ISO standards are the bible for me but I didn't notice that "programming" was the only tag. Apologies and +1 by way of saying sorry.
paxdiablo
2010-01-21 07:24:40
@paxdiablo: Well, to be fair, everyone else *does* call them "compound assignment" operators. But doesn't "augmented assignment" sound just so much more *awesome*? Anyways, fixed.
Ignacio Vazquez-Abrams
2010-01-21 07:26:22
I've actually never heard them called *any* of those. One wag (no names, no pack drill, and they've since deleted the answer) gave us "increment compound assignment operator" which I thought was hilarious - surely plus-equals is so much more succinct :-)
paxdiablo
2010-01-21 07:32:03
Here's an example of the use of *augmented* for "+=" and "++" in C: http://groups.google.com/group/comp.lang.c/msg/689766f8ffcbee5c.
Alok
2010-01-21 07:32:31
A:
Hello H4cKL0rD += is the plus and Equal operator. If you assign a+=3 That means u assign the expression are a=a+3.
RRB
2010-01-21 06:48:26