Service Objects: Beyond Fat Models and Skinny Controllers

Wow, that is some really terrible code.

Extracting logic to improve readability was a good idea, but it was downhill from there into a module that is the epitome of SRP violations, terrible ideas like "specialized classes that hold a single action", and "method names could be: call, execute, run".

If your method name is call, I hope it was on an object representing a telephone number. Execute is for victims. Run is for dogs. Use intentional names for your methods, and extract code into objects that represent something tangible, not procedural junk drawers.

I leave you with this horrifying quote:

it's a good thing to avoid instantiating objects whenever it's possible

Seriously. Just. No.

/r/ruby Thread Link - ombulabs.com