-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
There have been a couple of proposals exploring how improve the readability of conditional operations that involve negation. Some developers find the nesting of parenthesis to be unattractive at best and easy to miss at worst.
I would like to explore the potential of allowing for a negation prefix operator ! to appear outside of the required parenthesis for if and while conditions so that the condition is effectively reversed:
if !(foo is Bar bar)
{
// stuff
}
while !(finished)
{
// stuff
}
do
{
// stuff
}
while !(finished);Certainly minor and the argument can definitely be made that the negation is even less obvious. It also doesn't address concerns with operators that would still require parenthesis, e.g. is.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels