What does += means? And why we use it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does += means? And why we use it?

16th Jun 2016, 8:31 PM
Utpal Kumar
Utpal Kumar - avatar
4 Answers
+ 1
Why not to use x=x+y than to use x+=y
16th Jun 2016, 8:33 PM
Utpal Kumar
Utpal Kumar - avatar
+ 1
It reduces the amount of code needed. There are allot of ways to shorten your syntax when coding in C#, it all adds up with bigger projects! It can result in smaller file sizes, quicker applications, and easier to read code.
16th Jun 2016, 11:58 PM
Malachi Jones
Malachi Jones - avatar
+ 1
It's called as shorthand, it makes code easy and short
19th Jun 2016, 10:20 AM
Melwin Vinod
Melwin Vinod - avatar
0
there are no real rules about wich one to use when. it Has more to do with readability.
17th Jun 2016, 2:34 PM
Xavier Vinken
Xavier Vinken - avatar