-
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
[coffee] assignment to conditionals #2
Comments
What's your preference here? I'd prefer the latter, unless L1 > 79 chars. |
I prefer former because a) it's simpler (no "unless L1 > 79 chars" condition to keep in mind) and b) it makes if more obvious for my brain to recognize what's going on: i.e. The primary function of what is happening here is an assignment which is conditional. The assignment has its own hierarchy above the conditionals. |
imho result = is an entire line w/o meaning and therefore to be avoided. If we have to break lines for > 79chars we'd probably do it elsewhere anyways result = if someFunctionThatHasALongNameAnd(takes
a
lot
"of"
args
)
wat
else
wot needless to say this code is super ugly anyways |
but still prettier than result =
if someFunctionThatHasALongNameAnd(takes
a
lot
"of"
args
)
wat
else
wot where we have to indent one level further |
Ha, this is clearly a subjective perception difference. I'd absolutely prefer your second example. Make it much easier for me to grasp what is happening. Reason probably is that I don't read line-by-line but I observe blocks. I agree that the line itself
doesn't mean anything, but it is not without context. In context, it makes more sense for me. But then again, it really doesn't make that much of a difference and you can argue that the other variant is better for you, so it probably doesn't matter. |
I open this for discussion. Should it be:
or
Both produce the same output.
The text was updated successfully, but these errors were encountered: