??= Operator #725
Replies: 5 comments
-
duplicate of #34 ? |
Beta Was this translation helpful? Give feedback.
-
Yes, this is a dupe. |
Beta Was this translation helpful? Give feedback.
-
Great minds think alike, and sometimes so do ours. (However, great minds use search engines. 😉) |
Beta Was this translation helpful? Give feedback.
-
I must not have been searching with the right words. Either way I'll check out #34. |
Beta Was this translation helpful? Give feedback.
-
@chuck-flowers Oh, it happens to me too. Just did the same thing myself. 😳 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I apologize if this has already been addressed but I could not find any issue dealing with it. I have found myself wanting this operator more and more recently.
A few years ago in C# we had to write this
Now we can write
But it can still get very lengthy with longer descriptive variable and type names
What I would like is a compound assignment operator that can be used like so
I feel like it more concisely conveys intent and that it is a common enough pattern it's deserving of a language feature. If this is considered an antipattern of some sort with a better solution, please feel free to let me know because I'm getting tired of typing the same variable names back to back like this.
Beta Was this translation helpful? Give feedback.
All reactions