Lets say i am writing a web app that accesses user accounts in a database. If the account exist use that data. But if the account doesn't exist create a new one.
Should this be done with two or one methods.
One method would search by name and if found get the account, but it would have a try catch block and if the query returned empty it would create the account with the name passed in.
Two methods would simply search and the create.
The benefits of one method would benefit from simplicity and code reuse but then that method is doing multiple things. And I have been told that is a bad thing. Where as two methods would would be separated well but it would have no code reuse.