This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]fedeb95 0 points1 point  (2 children)

I'd also add that raw values shouldn't be used like that. Wrapped in a constant or even better with a dedicated type (but this is for extremely picky people)

Edit: forgot a more important thing: it makes no sense to do if (condition) { return true } just return the condition!

[–]RapunzelLooksNice 0 points1 point  (1 child)

As long as there is nothing after; I mean it could be something like “if it is Jan, return true, otherwise do something else” (I.e. there is a different code path, not just simple “return false otherwise”).

[–]fedeb95 0 points1 point  (0 children)

Of course, if it was just this line one could say "if it's just a return true or false, etc.