the two special cases imo are `return` and simple throws (I abstract complex throws when used in guards to keep 'em shirt)
-
-
Replying to @wycats @BrendanEich
I like forcing return to be on next line because I see all exit points when scanning vertically
1 reply 1 retweet 12 likes -
Especially useful when there is no highlighting, like in diffs
2 replies 0 retweets 2 likes -
Spotting returns is valuable to avoid accidentally putting teardown logic after early conditional return
2 replies 0 retweets 3 likes -
Replying to @dan_abramov @wycats
Well put. Being able to "see" the control flow graph is valuable; as is early-return (and no else-after-return gaffe!).
2 replies 0 retweets 2 likes -
Replying to @BrendanEich @dan_abramov
function f(b) { if (b.isValid) { return; } if (other) { more(things) } } not better imo.
3 replies 0 retweets 2 likes -
Replying to @wycats @dan_abramov
yeah, I wasn't recommending what you showed there -- did you misread?
1 reply 0 retweets 0 likes -
I reject always-brace for exactly this guard-return reason; we are agreeing. No hiding returns, no else after return.
2 replies 0 retweets 0 likes -
Replying to @BrendanEich @dan_abramov
Right. We're agreeing. `always-brace` is the dominant lint, my style not even an option (that started this convo)
2 replies 0 retweets 0 likes -
I've repeatedly failed to get the style changed *in my own projects* because of lack of good lints
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.