You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Roslynator's RCS1089 warning: Use ++ operator instead of assignment. crops up a lot. It doesn't like this:
count+=1;
and tells you to change it to this:
count++;
I don't like the suggestion in these examples because these statements are purely about the side-effect, so I prefer the presence of an = symbol to emphasize that. My view is that the ++ operators might be a better idiomatic fit in cases where you are also using the value (although compound assignment returns the value in addition to having a side effect, so you can use that in those cases too) but I don't really see any benefit in using ++ in the case shown above, and I see a downside.
I've disabled this warning in a few projects using `Endjin.RecommendedPractices, so I would like to make this part of our defaults.
The text was updated successfully, but these errors were encountered:
Roslynator's RCS1089 warning: Use ++ operator instead of assignment. crops up a lot. It doesn't like this:
and tells you to change it to this:
I don't like the suggestion in these examples because these statements are purely about the side-effect, so I prefer the presence of an
=
symbol to emphasize that. My view is that the++
operators might be a better idiomatic fit in cases where you are also using the value (although compound assignment returns the value in addition to having a side effect, so you can use that in those cases too) but I don't really see any benefit in using++
in the case shown above, and I see a downside.I've disabled this warning in a few projects using `Endjin.RecommendedPractices, so I would like to make this part of our defaults.
The text was updated successfully, but these errors were encountered: