I really miss ruby tail guards: def foo(bar) return unless bar.valid? # rest of function end
-
-
I feel that the "guards-first, then newline" style is visually very very clear.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
yeah, I wasn't recommending what you showed there -- did you misread?
-
I reject always-brace for exactly this guard-return reason; we are agreeing. No hiding returns, no else after return.
-
Right. We're agreeing. `always-brace` is the dominant lint, my style not even an option (that started this convo)
-
always-brace is crockfordian overkill.
-
I've repeatedly failed to get the style changed *in my own projects* because of lack of good lints
End of conversation
New conversation -
-
-
Agree. In fact, Ruby's post if is nice for guards. def foo(x) return unless x > 8 # ... end
-
Because you immediately see it's a guard. Using `guard` even better!
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.