I guess we'll have to agree to disagree. Again, I believe in the opposite of what you have said. To me, it is more much more readable.
The purpose is not to simply shorten code. The purpose is learn alternatives to the if statement.
The reason why it is important to learn alternatives to an if statement is because I am trying to promote functional programming and if/else are imperative statements.
So, because if/else is imperative, it is therefore anti-functional. So if you want to start coding in a functional way, you will need to learn alternatives to the coding styles you might be comfortable with.
Learning multiple ways to solve the same problems makes you a better programmer.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.