Makes me sad when that gets called "clever". "Mapping A B C to X Y Z by using a Map object? Too clever!!" Good grief. I'd fail the else if chain in code review and suggest the switch statement. Map is ok too.
But the article title had me anticipating ternary expressions and array.filter(lambda) as well.
But even with, I don't think of if statements as unclean, just that there's more succinct ways of doing some of the more common things that they're used for.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Makes me sad when that gets called "clever". "Mapping A B C to X Y Z by using a Map object? Too clever!!" Good grief. I'd fail the else if chain in code review and suggest the switch statement. Map is ok too.
But the article title had me anticipating ternary expressions and array.filter(lambda) as well.
But even with, I don't think of if statements as unclean, just that there's more succinct ways of doing some of the more common things that they're used for.