News for hackers. Stuff that matters.
Re:Shopify now on Rails 5.0. started 12 years ago on 0.5, th... by Humjob on Saturday January 21, 2017 @01:12AM (#13449093)
That's a LOT of code in the controllers. If I had to guess, it sounds like they're putting business logic in their controllers, which is a fairly well-established anti-pattern.

How's Shopify's platform performing these days?

Re:Shopify now on Rails 5.0. started 12 years ago on 0.5, th... by pmontra on Saturday January 21, 2017 @02:47AM (#13449293)
They have 452 classes in controllers and 41374 LOC. It's an average of 91.5 lines of Ruby per controller, not so many for the usual 7 scaffolded methods and some extras like strong params.

About performances, I always thought that writing logic in controllers, models or lib was a matter of readability and ease of maintenance.

Does it make a difference to the CPU if 50 lines of code run in a controller or in a model or in a file in lib or in a gem?

Maybe do 452 controllers slow down the router?

Re:Shopify now on Rails 5.0. started 12 years ago on 0.5, th... by kondro on Saturday January 21, 2017 @01:51AM (#13449189)
Excellently.