Re: MMAP Buffers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: MMAP Buffers
Дата
Msg-id 23881.1302935768@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: MMAP Buffers  (Greg Smith <greg@2ndquadrant.com>)
Ответы Re: MMAP Buffers  (Greg Smith <greg@2ndquadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: MMAP Buffers
Следующее
От: Greg Smith
Дата:
Сообщение: Re: MMAP Buffers