You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, just wanted to create a discussion around the following:
When we have an if-else statement, it is used in 2 different ways based on a business logic rather than syntax:
2 equally logical branches ( if the customer is private do this, if business do that). In this case we could have when() construct replacing if() to make total sense, but if() is used more often in the cases like this.
main and else branch (if notnull do this, else quit).
With your "whatIf" and "whatIfNot" functions, you're using the first way of branching.
Do you think it would make sense to have a clear separation of those 2 ways by adding more "sugar"?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey, just wanted to create a discussion around the following:
When we have an if-else statement, it is used in 2 different ways based on a business logic rather than syntax:
2 equally logical branches ( if the customer is private do this, if business do that). In this case we could have when() construct replacing if() to make total sense, but if() is used more often in the cases like this.
main and else branch (if notnull do this, else quit).
With your "whatIf" and "whatIfNot" functions, you're using the first way of branching.
Do you think it would make sense to have a clear separation of those 2 ways by adding more "sugar"?
Beta Was this translation helpful? Give feedback.
All reactions