The Artima Developer Community
Sponsored Link

Ruby Community News Forum
Does Convention over Configuration Mostly Help Green Field Projects?

3 replies on 1 page. Most recent reply: Aug 30, 2006 11:40 AM by Jules Jacobs

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Bill Venners

Posts: 2242
Nickname: bv
Registered: Jan, 2002

Does Convention over Configuration Mostly Help Green Field Projects? Posted: Aug 29, 2006 2:39 PM
Reply to this message Reply
Summary
Favoring convention over configuration is a technique popularized by Ruby on Rails, but it can be used in any language or framework. To what extent does the productivity advantage that can be gained from this technique hinge on whether the project is a green field design?
Advertisement

In You Shouldn't Compare Rails to Java EE 5, or JavaScript/Ruby to the Java Language, Adam Bien suggests that the technique of favoring convention over configuration is most suited to green field designs—brand new designs that have no requirements to fit with legacy code and infrastructure. The technique of "favoring convention over configuration" was recently popularized by Ruby on Rails, but can be employed in any language in any framework. The technique is given credit as one of the main ways Rails helps make programmers more productive at building web applications. Bien states that in the projects he's worked on, often the database already existed, and therefore, "The 'convention over configuration' advantage was gone." In addition, Bien states that "in the last 11 years, I had only few 'green field' projects."

To what extent do you believe that convention over configuration is most helpful for green field designs? How often have you been able to work on a green field design?


Roland Pibinger

Posts: 93
Nickname: rp123
Registered: Jan, 2006

reasonable defaults Posted: Aug 30, 2006 4:52 AM
Reply to this message Reply
Convention vs. configuration is misleading. A library or framework should have reasonable defaults that let you use it 'out of the box'. It should be configurable for special cases but configuration should be an exception, not the norm. A library eg. that requires the user to write heaps of XML configuration files to perform standard usage clearly misses the point.

Jules Jacobs

Posts: 119
Nickname: jules2
Registered: Mar, 2006

Re: Does Convention over Configuration Mostly Help Green Field Projects? Posted: Aug 30, 2006 11:39 AM
Reply to this message Reply
It's true that convention over configuration doesn't help much if you don't follow the conventions (because you're working with an existing db for example). On the other hand, there aren't many projects where you don't create new things at all. You can use convention over configuration if you have control over these new things.

An example of convention over configuration:

def generate_pi(decimals = 10)
  # compute pi
end
 
compute_pi() => 3.14...
compute_pi(2) => 3.1


The convention is that you compute pi upto 10 decimals. This will be enough for most uses, but you can override it if you want.

Such small-scale convention over configuration is also valuable in existing projects.

Jules Jacobs

Posts: 119
Nickname: jules2
Registered: Mar, 2006

Re: Does Convention over Configuration Mostly Help Green Field Projects? Posted: Aug 30, 2006 11:40 AM
Reply to this message Reply
The example should be:

def compute_pi(decimals = 10)
  # compute pi
end
 
compute_pi() => 3.14...
compute_pi(2) => 3.1

Flat View: This topic has 3 replies on 1 page
Topic: Two Ways to Build a DSL Previous Topic   Next Topic Topic: Starter Toolkit for DB2 on Rails Released


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us