Re: MMAP Buffers - Mailing list pgsql-hackers

From Tom Lane
Subject Re: MMAP Buffers
Date
Msg-id 23881.1302935768@sss.pgh.pa.us
Whole thread Raw
In response to Re: MMAP Buffers  (Greg Smith <greg@2ndquadrant.com>)
Responses Re: MMAP Buffers  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-hackers
Greg Smith <greg@2ndquadrant.com> writes:
> Reading one's own diff and reflecting on what you've changed is one of 
> the extremely underappreciated practices of good open-source software 
> development.  Minimizing the size of that diff is perhaps the most 
> important thing someone can do in order to make their changes to a piece 
> of software better.  Not saying something that leads in that direction 
> would be a disservice to the submitter.

A couple further comments on that thought:

* Another argument for avoiding unnecessary changes is that the larger
your patch's change footprint, the more likely it is to create merge
conflicts for people working on other patches.  Now, if they're
necessary changes, that's the price of parallelism in development.
But gratuitous whitespace changes add nothing and they do have costs.

* On the other side of the coin, I have seen many a patch that was
written to minimize the length of the diff to the detriment of
readability or maintainability of the resulting code, and that's *not*
a good tradeoff.  Always do what makes the most sense from a long-run
perspective.

I keep wanting to do a talk arguing that everything you need to know
about good patch style can be derived from the mantra "Make the patch
look like the code had always been there".  If the functionality had
been designed in on day one, where would it be placed and how would it
be coded?  You might be able to make the patch diff shorter with some
shortcut or other, but that's not the way to do it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: MMAP Buffers
Next
From: Greg Smith
Date:
Subject: Re: MMAP Buffers