On Feb 16, 2008 1:38 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> So here's a question - I want to start (or restart?) a discussion on
> the role of scaffolding. Should I do that here, or in Talk? I'm
> inclined to say here, since it would (hopefully) have a noticeable
> impact on core... and given that, I'll go ahead and say my piece (and
> just repost it to Talk if that's the consensus).
>
> As it currently stands, scaffolding is broken. We all know it's not
> production-ready code (unlike, say, Django's), and it doesn't really
> educate new users in the best practices of Rails development (it uses
> for loops, has insufficient testing, etc.).

Education is the goal with scaffolding, not production ready code.
For your specific complaints: We've had discussions on the merits of
for loops and .each before, but I think it's an awful stretch to say
it's a 'bad practise'.  It's basically impossible to generate decent
tests given a single table name and the attributes.

Having said that, any patches which people think will help people
learn will be greatfully received.  I'm willing to admit that I'm
hardly scaffold's target audience, so if you can think of anything
which will help out new users, I'd be glad to talk about that.

\> My proposal, then, is to separate these goals. Refocus scaffolding on
> providing solid, usable code, and accept patches that move it closer
> to that. Instead of just abandoning the educational aspects, however,
> split them out and address them in a downloadable sample application
> that is designed to teach best practices - something like the caboose
> sample app (though that hasn't been updated since May, I think). I
> think this will go a long way towards meeting both goals - scaffolding
> will be more useful, and new developers will have a focused sample
> application to learn from.

The nice thing about learning from scaffolds is that you're learning
from *your* domain, so you don't have to spend the whole time mentally
transforming relationships and code from 'blog' to 'insurance
policies'.  The biggest downside of sample apps is what you've already
mentioned,  they're bloody hard to keep updated.  It's a sample
application, who has the motivation to keep it current?

I think perhaps there's another option, enhance scaffolding so it's as
good an introduction as it can be.  Then provide sample applications
for people to learn more detailed best practises.

-- 
Cheers

Koz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to