DEV Community

Discussion on: 5 Bad Practices That Can Make Your C# Code Messy - And How to Avoid Them

Collapse
 
stegriff profile image
Ste Griffiths

I get that you're trying to contrive a situation, but I think you should come up with something more in-depth for this:

bool shouldProtect = hasApplication ? true: false;
Enter fullscreen mode Exit fullscreen mode

Because it could just be:

bool shouldProtect = hasApplication
Enter fullscreen mode Exit fullscreen mode

...which means you probably don't need the shouldProtect variable at all...