Hi –
On Tue, 25 Nov 2008, Ralph W. wrote:
making my own CRUD base files and copypasting it into every project?
I just don’t get it.
Here are a few problems I’ve seen, and continue to see, with the
scaffolding.
It leads people to think that Rails is going to be dead easy, and then
they get frustrated or disappointed when it turns out that developing
a Rails app is real development and real programming.
Although it pertains usually to the beginning stages of an
application, it does not play well with the beginning stages of
learning Rails. It presents way, way too much code to be useful to
beginners. The controller files can be a useful “cheat-sheet” for REST
idioms, but only once the basic techniques and principles are
understood.
As you point out, the scaffolding makes you tweak things and remove
wrong things, instead of developing what you actually need. It turns
development into sculpture (remove everything that isn’t your
application!), and introduces anxieties about whether you’re doing
something wrong because you’re changing something fundamental about
the scaffold code, etc.
It presents a very rigid and specific context for the idea of a
“resource” (in the REST sense), which then impedes people from gaining
a broader understanding of what a resource can be. For more on this
problem, see:
http://dablog.rubypal.com/2008/3/23/splitting-hairs-over-resource
http://dablog.rubypal.com/2008/4/24/splitting-hairs-over-resource-part-2
I agree with the point that others have made that if you know exactly
what the scaffolding provides, and you’ve got a situation where that’s
exactly what you need, there’s no harm in using it. If those
particular boilerplate files happen to coincide with what you want,
that’s great. Otherwise, I’d avoid it. There’s no reason to give it
first refusal of your development space, just because it’s there.
David
–
Rails training from David A. Black and Ruby Power and Light:
INTRO TO RAILS (Jan 12-15), Fort Lauderdale, FL
See http://www.rubypal.com for details
Coming in 2009: The Well-Grounded Rubyist (The Well-Grounded Rubyist)