Hello i have two samples of code
if/else if/else statements
private Object getObj(message) {
if (message
In my opinion after around 20 years of commercial experience, I've formed a view that pursuing readability is absolute stupidity, and at the same time, intentionally writing convoluted code is evil.
I know this goes totally against popular opinion.
However, everyone needs to realize this...
if
or Optional
are more readable or not. These kinds of debates will occur irrespective of what constructs or situations we are in.if
option, which is more performant than the functional approach, each and every time, then the people reading that code will get used to it and find it MORE READABLE - because it is the style that they have now become accustomed to.So, in essence: go with the if
... do NOT use that Optional
!