Personally I prefer all-or-nothing for braces, I really don't like mixing styles. If any of my code has braces, I'd prefer all of my code to have braces. But this is totally off topic and probably a topic for another C/V poll!
I'll save it for another ✔️||🤢 good idea.
Just have to come up with a good example 😊 and not posting a new one every day is hard but I think this is going to be a weekly recurring item from now on 😎
I personally like to drop the braces IF the condition is small and the statement ends control flow and logically can't have anything after, like return, throw, continue, break, etc.
Since you're returning on each case I wouldn't even bother with elses...
Of course I'd also extract that second conditon into another method, but that's another matter.
Um, making it a bit inline is better imo.
The first line for the second if statement is too long imo. Turned it into two lines.
Personally I prefer all-or-nothing for braces, I really don't like mixing styles. If any of my code has braces, I'd prefer all of my code to have braces. But this is totally off topic and probably a topic for another C/V poll!
I'll save it for another ✔️||🤢 good idea.
Just have to come up with a good example 😊 and not posting a new one every day is hard but I think this is going to be a weekly recurring item from now on 😎
I personally like to drop the braces IF the condition is small and the statement ends control flow and logically can't have anything after, like return, throw, continue, break, etc.
My preference:
Oh yeah, I didn't thought that.