Hacker News new | ask | show | jobs
by dedsm 3686 days ago
I've always said Rails is good for short-lived build and forget projects, it's too "magic" for my taste.

I can't imagine what it must feel like to receive a mid-to-large sized Rails project to maintain.

1 comments

You don't want to know. I inherited and am currently tech-leading a large e-commerce project powering an e-shop doing $10k+ sales a day. Even a small bugfix or a very minor UI addition is taking days because outdated tests are breaking, because there are dozens of tight integrations directly in the code, because there's zero separation of concerns, and awfully inefficient ActiveRecord queries everywhere. Making a cart checkout with ONE item takes 50+ ActiveRecord queries. Yep...

It is extremely challenging and very educational for me, and I appreciate the experience. I've always been a fan of repairing and improving things -- but truth be told, it gets tiresome and annoying VERY quickly.

I am currently working hard to stabilize the entire process of small refactorings for the sake of the new features/bugfixes, streamlining deployment, making full separate QA/Staging environment (yes, even that wasn't addressed by the previous team) so we can test with confidence and without fearing we'll break Prod, and to reduce the 3rd party API dependencies -- right now they are 20+.

I am hopeful that after I stabilize the project and make the process of introducing new code easier and quicker, I could then make the case for gradual exodus to Elixir/Phoenix. Realistically, I am not seeing that Rails abomination I inherited to be a sustainable job for even one year. Inevitably I'll burn out, the customers will lose patience, and my employer will be unhappy both with me and the customers. Not cool for anyone involved.

So I'll try to gradually run away from Rails. As pointed by numerous smart people here, it's suited for medium-sized projects at best. Even Sinatra/Padrino and 50+ attached libraries would have been much easier to maintain.

Ive got a similar problem, dealing with a rails app i inhereted that collects telemetry data from thousands of remote units traveling out in the field. Basically there is no separation at all of active record and buisness logic. You end up with connections to ftp servers and other application layer adapters down in active record models. With all of the application layer in the AR models its only a matter of time before the developers end up weaveing a thick carpet of spaghetti dependency through everything.

On top of that changing the database becomes a royal nightmare because the database is what defines this AR model that all of your buisness logic and application layer spaghetti dependency relies on. The databases usually end up full of garbage because without complex validations and lots and lots of tests which by the way were never written ruby and rails will dump any trash into your db whenever. So you end up with columns with like 10 variations of the definition of NULL or FALSE.

Usually around this point your app just slips into a state of quantum uncertainty. It essentially ceases to behave deterministically at least when viewed from within the bounds of human perception.

Its hard for experienced developers to bend rails in away so that things don't become overly dependent on each other and neigh impossible for average or beginner rails developers to manage.

Im just really not impressed with rails at all especially coming off of 6 years of development time on huge enterprise apps written with the c# .net libraries. I mean really they are light years ahead using IOC dependency injection for injecting service apis into controllers while using mapping patterns for keeping buisness and database logic separate. Its the only way to break up large apps and keep them sane and maintainable. Additionally static typing is the only thing that keeps things sane in really large applications doing complex business logic through many layers of interfaces.

Hey and sorry for replying with so much delay. I keep forgetting HN won't send me mobile notifications for replies.

Truth be told, I am not sure how well will I cope. I am good, I have experience, I have been doing lots of quality repairs in my life before. But you know what? At certain point you don't think it's worth your time and energy. That's the real enemy here -- demotivation.

I spent humongous amounts of time in the object-oriented land. I think I'll just hop to the functional programming world -- isolated functions, functions as first-class citizens, immutability (hell yes!), no shared shate (oh God please, I want that!), and goodbye side effects. At least I hope so. It might just be another shiny thing I'll be pursuing and won't be much better. We'll see.

But you know what? I prefer working hard to build things from the ground up in a new and much better language and ecosystem than to spend my life trying to demystify somebody's strongly opinionated framework which doesn't cover even 40% of what I need in my project.