[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Space-before-paren or not?

From: <kfogel_at_collab.net>
Date: 2006-01-29 14:50:34 CET

(Sorry to miss the beginning of this thread -- I was busy freezing my
pons off in Poland.)

Some thoughts, followed by a proposal:

It was probably a mistake to allow inconsistent function-call
formatting when the project started. We should have picked a style
and stuck with it. The inconsistency has added overhead to patch
review, plus generated some threads on this list.

Neither style is better, it's a matter of taste. Furthermore, no one
here would stop contributing to Subversion if the project were to
choose a style that was not that developer's preferred style. We're
all experienced developers, any of us can cope with either format.
(And if someone can't, speak up now.)

Statistics on function call formatting in our C code:

  * space-before-paren (16 modules, 123546 lines of code, 77% by line):

    libsvn_auth, libsvn_client, libsvn_delta, libsvn_fs,
    libsvn_fs_base, libsvn_fs_fs, libsvn_ra, libsvn_ra_local,
    libsvn_repos, libsvn_subr, libsvn_wc, svn, svnadmin,
    svndumpfilter, svnlook, svnsync

  * no-space-before-paren (6 modules, 36069 lines of code, 23% by line):

    libsvn_diff, libsvn_ra_dav, libsvn_ra_svn, mod_authz_svn,
    mod_dav_svn, svnserve

  * seems to use both styles (1 module, 263 lines of code, ~0% by line):

    svnversion

(I left libsvn_ra_serf out of the calculation because it's the library
that started this discussion, and could go either way depending on our
decision.)

That's a pretty dominant majority for space-before-paren. If we're
going to pick a style, space-before-paren would be consistent with the
greatest amount of existing code. I'm *not* proposing that we
reformat old code -- that would pollute our blame information and make
outstanding patches harder to apply, and IMHO consistency is not worth
those inconveniences.

So, that's my proposal: new code (including libsvn_ra_serf) gets
space-before-paren, but old code is left as-is. Consensus?

I could go either way on whether old code should preserve its current
format when edited. As part of other changes, it could slowly morph
into the prevailing style... but there would be a long period of
inconsistency, even within the same source files. That doesn't bother
me terribly, but it might bother other people. Thoughts? (We don't
have to resolve this question at the same time as we resolve the
question of what format new code should be in, that's why I'm starting
a discussion on it even while requesting consensus on the larger issue.)

If we don't have consensus on new code, then let's just have a vote.
I volunteer to arrange the ballot, but don't want to bother unless we
don't get consensus now. With the hard data above, everyone would
know the implications of their vote. (I know Peter took a straw poll
before, but the subject line didn't make it clear that he was calling
for a vote, so we should probably try again if we want a real vote.)

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 29 16:28:27 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.