2 ms·
To me the point isn't so much separation of concerns as it is separation of side-effects. printf has a well design side effect (printing to stdout). Coolclass.
by phamilton 10y ago
To me the point isn't so much separation of concerns as it is separation of side-effects.
printf has a well design side effect (printing to stdout). Coolclass.new has an expectation of an instantiation of object in memory. If Coolclass.new also called an external service, then that would be a violation in my opinion. Thankfully, we generally don't do that.
User.create is not only capable of tons of side effects (just like Coolclass.new) but it is encouraged to do so (via callbacks and such).