[darcs-devel] Re: darcs patch: Fix soul-hurting hardcoded file descriptor number

David Roundy droundy at abridgegame.org
Sat Jan 29 03:16:03 PST 2005


On Fri, Jan 28, 2005 at 06:50:38PM +0000, Aaron Denney wrote:
> On 2005-01-28, Juliusz Chroboczek <jch at pps.jussieu.fr> wrote:
> >> [Fix soul-hurting hardcoded file descriptor number
> >> Jan-Benedict Glaw <jbglaw at lug-owl.de>**20050127235644] {
> >> hunk ./compat.c 16
> >> -    ret = fstat(1, &s);
> >> +    ret = fstat(STDOUT_FILENO, &s);
> >
> > I've got a K&R 2nd ed. right here, and they use 1 (Chapter 8).
> >
> > Si de gustibus non disputandum...
> 
> Right.  After awhile doing C programming with the Unix API, "1" is very
> very clear in this context, and STDOUT_FILENO is a long unreadable (upper
> case is much less readable than lower) string that has to be decoded.
> 
> I don't strenuously object to this patch at all, but I think it slightly
> hurts readability, rather than aiding it.  But I'm not the maintainer.

I'm pretty much ambivalent.  I chose to use "1", but figure if whoever is
working on the code can choose the style they prefer--unless I think it'll
affect maintainability, which in this case it doesn't.

On the C side, I don't have any strong preferences as far as style goes.
On the haskell side, I do tend to ask for changes if there are stylistic
problems with a patch (in my opinion of course--that being the only one
I've got), both because there's more haskell code out there, and because
often there are idiomatic changes in haskell that can make a big difference
in readability.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list