Why are there no short-circuiting compound assignment operators `&&=` and `||=`?

some-java-user-99206970363698485155 at vodafonemail.de some-java-user-99206970363698485155 at vodafonemail.de
Tue Aug 11 11:55:44 UTC 2020


Thanks to both of you. When I wrote this mail I was indeed mostly thinking "it would be neat to
have this feature" due to the cases I saw where it could be beneficial.
However, I was not considering the overhead this small feature would cause.

> how much developers will remember and use effectively
This is a good point as well. The addition of these operators would likely not get the attention 
features like switch expressions or records get so most developers likely wouldn't even know that
these operators exist and possibly instead even remember that the operators did not exist in the past.
Though hopefully at least new programmers would at some point be aware of their existence.

> most developers benefit from the language being as simple as possible
If you know the concept of compound assignment operators and know the `&&` and `||` operators, then I 
don't think adding the respective compound operators for them would add more complexity.


More information about the discuss mailing list