-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
Annoyed by polluted code and people not understanding what safe navigation operator is and using it everywhere.
If it is known that a variable can't be nil
, suggest removing useless safe navigation calls.
# bad
x = var.foo # <--- here, if var is nil, an error will be raised in any case
var&.bar # <--- unnecessary safe navigation
# good
x = var.foo
var.bar
# bad
if var
var&.foo
end
# good
if var
var.foo
end
vlad-pisanov and CvX