Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
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.
Cheers!
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.
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.
Cheers!