-
Notifications
You must be signed in to change notification settings - Fork 913
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
else/else if on newline #91
Comments
"} else .." has a more natural feeling to it. |
to comment |
So why u dont prefer this?
You can comment whole code block this way. I think if code consists of lots of lines it looks more complicated. |
@pokatomnik Because |
|
If-else condition contains several repeated patterns of: keyword [condition] code_block.
This style contains less parts then monolithic if-else. And as I mentioned before It produce exact diffs when new statement added or removed. |
I prefer to move logic constructions in separated lines:
This makes code more git friendly (like trailing commas). And also it makes it simple to comment
else if
andelse
sections. Each block is prepended with it's own condition.The text was updated successfully, but these errors were encountered: