I think he’s being a bit overaggressive here in labeling things antipatterns. Class variables and multi-object files in particular have niche use cases, but that doesn’t make them bad.
The safe navigation operator, as well, is designed to directly replace if x then x.y which is the pattern he’s really concerned with. But we don’t always control the definition of objects we interact with.
Some of these are obvious, some are possible footguns but not antipatterns (class variables), and some are just good features of the language and not antipatterns at all (safe navigation and numbered block params, at least specifically _1)
I think he’s being a bit overaggressive here in labeling things antipatterns. Class variables and multi-object files in particular have niche use cases, but that doesn’t make them bad.
The safe navigation operator, as well, is designed to directly replace
if x then x.y
which is the pattern he’s really concerned with. But we don’t always control the definition of objects we interact with.Mostly uncontroversial, but I find the safe nav bit to be a bit unrealistic.
nil
all the time as a meaningful value (e.g.Enumerable#find
).Some of these are obvious, some are possible footguns but not antipatterns (class variables), and some are just good features of the language and not antipatterns at all (safe navigation and numbered block params, at least specifically
_1
)