3 ms·
That first code might just be the implementation of updatePhoneNumber. You are just moving the problem.
by qznc 13y ago
That first code might just be the implementation of updatePhoneNumber. You are just moving the problem.
- NateDad 13y agoSomewhere there has to be a check to see if the person with that id exists, and if so, change its phone number. It could be a SQL statement running in the db, it could be a null check, or a try/catch or it could be inside data_source.person(id) do |person| I'm just saying, it has nothing to do with nulls and everything to do with error handling. This teller pattern handles errors by implicitly ignoring them. If that's your intended behavior, that's fine. It also evidently has some nice language support in ruby, and that's cool. But it doesn't really "solve" any "problem". Mostly because there's no problem in the first place. Error handling is not a problem, it's a fact of life in software development.