Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I mean, it kind of makes sense. It shows, that getting null here is an expected behavior, but it's a special case that needs to be handled separately.
Expressing intent is much more important than brevity. -
Are the lines all aligned because that's how the programmer did it, or because you did it because that's easier than aligning them on the phone for ranting?
-
Zulukas187yI understand that this is a silly block of code that could've just been "return value;", but the "if (null != value)" just makes so irrationally angry. Make it "if (value == null)".
-
@beggarboy if you want to use the ternary operator in a return statement, at least do it properly:
return value == null ? null : value
But @olezhka is right, just write return value;
Related Rants
I was suppose to review this code.
if (null != value) {
return value;
} else {
return null;
}
rant
java
null
wk72
if else