KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have written functions that look like this: bool IsDry(bool isRaining, bool isWithUmbrella) { if (isRaining) { if (isWithUmbrella) return true; else return false; } else return true; } I need to check, if it's raining, then the person needs to carry an umbrella in order to keep dry (don't laugh, this is just an example, our actual business rules are more serious than this). How can I refactor this, because right now it looks clumsy. Thanks for the help, guys! =)
Tags (comma-separated)
Save Edits
Cancel