I really miss ruby tail guards: def foo(bar) return unless bar.valid? # rest of function end
-
-
Frankly, I find that no-newline + mandatory curlies to create way more visual ambiguity.
-
function f(b) { if (b.isValid) { return; } more(things); } ^^ visually less clear to me
End of conversation
New conversation -
-
-
When condition is long I could miss return at the end. But it depends for sure.
-
if the condition is long, I don't consider it a "guard" and don't use this style.
-
function f(b) { let valid = ...; let cached = ...; if (!valid) return; if (cached) return cached; // ...rest }
-
to be honest, I have no problem with any style, just speaking out against zero-tolerance for braceless, which is dominant
-
not that great for debugging; you gotta break on the evaluation or before & step through
-
just experience; i prefer succinct debugging. if something takes too much effort to debug it’s probably not great
-
what's hard to debug about it?
- 17 more replies
New conversation -
-
-
this pattern is great
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.