with a good linter, the risk Delta should be 0
-
-
Replying to @wycats @BrendanEich
I really miss ruby tail guards: def foo(bar) return unless bar.valid? # rest of function end
1 reply 0 retweets 8 likes -
Replying to @wycats
I know you do! Not gonna get into JS. Agree on linting point.
1 reply 0 retweets 0 likes -
Replying to @BrendanEich
yeah I don't need tail guards, but if (foo.isValid()) { return; } is a lot :)
1 reply 0 retweets 1 like -
Replying to @wycats @BrendanEich
with paren-free and getters and more targeted lints, that could have been: if foo.isValid return; Which seems fine for guards
1 reply 0 retweets 0 likes -
Replying to @wycats
the case of the "then" part being just 'return;' is indeed special: easy to read even when skimming.
1 reply 0 retweets 0 likes -
Replying to @BrendanEich
the two special cases imo are `return` and simple throws (I abstract complex throws when used in guards to keep 'em shirt)
1 reply 0 retweets 1 like -
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
hm... I haven't found "code reviews without highlighting" to lead to these kinds of mistakes personally...
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.