|
|
|
|
|
by gerggerg
5278 days ago
|
|
It's a bummer this article starts out with a quote about Rails providing a bad OOP learning environment and then talks about the framework itself never touching on the learning of OOP again. -- "it's lead Rails developers to build huge,
monolithic models that are hard to test,
and violate SRP."
...Sounds like you need to structure your code better. "Have you ever seen a 200 line long
controller method? I have."
... What on earth are you talking about? This has nothing to do with rails. Structure your code better. "The whole idea of logic in templates
leads to all kinds of problems."
...Then don't put logic in your templates. Use helpers or logic-less templates. "MVC has served the web well...
...But I think we're reaching its
limits"
...If the type of web app you want to make isn't best constructed with an mvc framework, don't use mvc. But honestly, I can't think of anyway to more blissfully implement a RESTfull webapp than with respond_to and resourceful routes. "This post is light on examples.
I want this to be the starting point
of a discussion"
...This exact discussion has been raging for years. Your only chance at gaining ground is through examples.-- This brings me to: When is this post from? I feel like it's 5 years old and I've slightly been had. |
|
That's actually a big part of the value of Rails: it picks one of the many ways to structure a web application (MVC with templates and an ORM), provides code to support that way, and (relevantly) sets conventions for code structure, directory layout (app/models/, lib/, etc).
It could have left some of those as plugins - like how Sinatra provides only routing and templating, and if you want MVC or ORM, you have to add them. But by making them part of the framework, Rails declared "here is one good way to structure a web app".
By pushing MVC, Rails helped developers avoid the pitfalls of one-page-PHP apps (mysite.com/index.php?page=news) - big entangled codebases with database access, HTML generation and business logic all intermixed. ActiveRecord helped developers avoid SQL injection attacks, repetitive query generation, and sprawling ORM config files. They made those problems trivial to avoid, and thus advanced the state of web development.
The OP acknowledges those contributions of Rails and ActiveRecord, but argues it's time for them to advance again, as there are new problems they need to tackle.