views:

353

answers:

5

Whats the name of this operator "+=" ?

+13  A: 

In c# it's called the addition assignment operator.

Fredrik Mörk
+14  A: 

Hey, The name is "plus equal" operator!

juanp
+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
Ya. +1 for being honest but wrong :)
George Edison
+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
+4  A: 

That is the Addition Assignment operator.

Michael Bray
+17  A: 

It, along with -=, *=, etc., are called the augmented assignment operators in Python, and "compound assignment" operators everywhere else.

Ignacio Vazquez-Abrams
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
@paxdiablo: http://docs.python.org/reference/simple_stmts.html#augmented-assignment-statements
Ignacio Vazquez-Abrams
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
@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
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
Here's an example of the use of *augmented* for "+=" and "++" in C: http://groups.google.com/group/comp.lang.c/msg/689766f8ffcbee5c.
Alok
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