33

no matter how big shot programmer you are, you 90% time you will only code
if(condition)
{
// do something
}
else
{
// do something else
}

Comments
  • 1
    Because more often than not we deal with booleans. However, I usually have an "everything else" case just to be safe.
  • 5
    you can apply the same logic to life in general.
  • 5
    (condition)?do something:do something else;
  • 3
    sometimes i use a switch case... :-)
  • 1
    😣
    if(condition) {
    //statement
    }
    else {
    //statement
    }
  • 0
    Hey with a map from (condition -> lambda function) you can get fancy and skip the if else/switches all together. And when it works you kinda feel smarter than when you started.
  • 1
  • 0
    @varundey with more if else it makee code hard to read 😢
Add Comment