-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guard let else return as a one liner? #9
Comments
+1 this for the oneliner |
+1 this for the... newliner (?) |
I think there's a bit of nuance here. When we need to do something as well as return, I think it should be the newline option. When it's just return, it should be the same line as the last guard statement. |
Although if we go with newliner it removes the nuance. |
In defence of newliner: it does make it easier to set breakpoints. (though you could always make it a newliner temporarily if you need to set a breakpoint). |
Yeah thats my primary reason @adriaan it just makes it easier when doing complex traces |
Sure. The code example only has |
In the codebase we're using two different styles of early returns:
and
We should pick one and stick to it.
The text was updated successfully, but these errors were encountered: