Wattle and daub

Posts you want to find years later go here.

Wattle and daub

Postby Jonathan » Mon Aug 02, 2010 9:44 pm

I am nearly positive I didn't come up with this analogy myself, but quick googling reveals no link. Anyway, a great deal of the software I use professionally on a daily basis has been grown organically. Frequently, it started from one person's itch, was released into the wild via source control system, and has been sort of hardened over time by the contributions of many individuals into something more or less production-worthy. Sometimes it was sensibly designed at first by the original author, but many other times it was just a hack thrown together because it was cheap, and propagated because it was useful.

I suspect much software is written this way. I am a believer in worse-is-better design. I am pretty happy with this state.

All too frequently, the software proves unequal to the task at hand, however. In this situation one of two things happens. Sometimes, someone gets a bee in his bonnet and architects the "right" solution from scratch. All the previous work is thrown out. The first 90% of the effort is getting the new design implemented. The second 90% of the effort is patching all the little niggling fixes that make software usable, the fixes that the collective intelligence of the user community provided for the previous wattle-and-daub implementation.

Other times, nobody cares enough to fix the irritation. Workarounds and horrible kludges are developed to keep things limping along. Everyone can see the system is basically busted.

Almost never does someone refactor existing code to use a new algorithm or what-have-you. It is always either add another layer of whitewash onto the sagging wall or burn the wall down and start over.

This state of affairs with broken legacy software bugs me. I think refactoring existing codebases is a good thing. I myself have never done so, almost always opting for the kludge route. I suspect this is fairly widespread. Is it?

Do you think refactoring should be occurring with the same regularity as redesigns? Greater frequency? Do you have a personal guideline or belief on when to give up and start over versus when to limp along with existing code?
Jonathan
Grand Pooh-Bah
 
Posts: 5983
Joined: Tue Sep 19, 2006 7:45 pm
Location: Portland, OR

Re: Wattle and daub

Postby VLSmooth » Mon Aug 02, 2010 11:07 pm

Refactor. Do it.
User avatar
VLSmooth
Tenth Dan Procrastinator
 
Posts: 3045
Joined: Fri Jul 18, 2003 2:02 am
Location: Varies

Re: Wattle and daub

Postby Jonathan » Wed Sep 29, 2010 1:56 am

Just to play devil's advocate here: so once I start down the path of refactoring, when do I stop? Nearly everything has some rough edges.
Jonathan
Grand Pooh-Bah
 
Posts: 5983
Joined: Tue Sep 19, 2006 7:45 pm
Location: Portland, OR

Re: Wattle and daub

Postby VLSmooth » Wed Sep 29, 2010 2:13 am

It's situational; factor in feasibility and the expected return of effort to you.

Imho, the time and effort saved by reigning in complexity, minimizing redundancy, and preventing human error alone makes most refactoring tasks I've encountered worth it. Also, the longer one waits to refactor, the more difficult it is to do (due to a variety of reasons, not the least of which is forgetfulness), which ultimately discourages refactoring later. Negative self-fulfilling prophecies suck.
User avatar
VLSmooth
Tenth Dan Procrastinator
 
Posts: 3045
Joined: Fri Jul 18, 2003 2:02 am
Location: Varies

Re: Wattle and daub

Postby VLSmooth » Wed Sep 29, 2010 2:15 am

Refactoring is also a form of temporal peer review, which can reveal flaws and provide useful insight.
User avatar
VLSmooth
Tenth Dan Procrastinator
 
Posts: 3045
Joined: Fri Jul 18, 2003 2:02 am
Location: Varies

Re: Wattle and daub

Postby Jason » Wed Sep 29, 2010 11:27 pm

I usually only refactor the sections that need to be more efficient or the sections that I need to build more stuff on top of. I try to leave everything else alone, since it doesn't make business sense to go back unless it's broken.
User avatar
Jason
Veteran Doodler
 
Posts: 1518
Joined: Thu Jul 17, 2003 11:53 pm
Location: Fairfax, VA

Re: Wattle and daub

Postby VLSmooth » Thu Sep 30, 2010 2:52 am

Jason wrote:refactor... the sections that I need to build more stuff on top of.

This has been especially applicable to me.
User avatar
VLSmooth
Tenth Dan Procrastinator
 
Posts: 3045
Joined: Fri Jul 18, 2003 2:02 am
Location: Varies


Return to The Vault

Who is online

Users browsing this forum: No registered users and 1 guest

cron