(no title)
BMorearty | 2 years ago
I think this is just plain incorrect. The example given later in this paragraph is the Rails `update` method--but the approach used in all canonical Rails examples and generators is the non-exception version of `update`.
ljm|2 years ago
I'd argue that now Ruby has some kind of pattern matching, it can take the place of using exceptions for control flow. You can just return the class itself instead of raising it, then match on it.
thibaut_barrere|2 years ago
lcnPylGDnU4H9OF|2 years ago
Do you happen to have an example of such control flow to link to? Not that I don't believe you but I wonder if there's a difference in what is meant by "control flow" between commenters.
That could be "control flow" to one person and "error handling" to another. Or even both to a third person.whalesalad|2 years ago
BMorearty|2 years ago
It may be true in Python--I don’t use it much--but I know Ruby well. It was my primary language for 13 years, at multiple companies. I taught it to over a thousand engineers at Airbnb over the course of five years. I still disagree that it is common to use exceptions for control flow.
Maybe it’s a matter of the interpretation of the word “common.” ¯\_(ツ)_/¯