On Thu, Mar 14, 2013 at 9:18 AM, Ken Giusti <kgiu...@redhat.com> wrote:

> Not to fire off a religious flame-war here - but this has stuck in my craw
> for awhile:
>
> Why is the proton C and Python code using 2 space indent?
>
> Two space indent does not conform with the existing QPID coding guidelines
> established for C++ nor Java:
>
> https://cwiki.apache.org/qpid/java-coding-standards.html
> https://cwiki.apache.org/qpid/cppstyleguide.html
>
> even python code should not be using 2 space indents, as God and Guido
> intended:
>
> http://www.python.org/dev/peps/pep-0008/#indentation
>
> Heck - the proton-j Java code uses 4 spaces!   We're not even
> self-consistent!
>
> Sorry to bring this up - there's plenty of real work that needs to be done
> for proton.  But I'm OLD, and my eyes ain't what they used to be.  Working
> with 2 space indents isn't fun.  In the case of python, it's damn painful.
>
> Going forward, can we please use 4 space indents?   And, over time,
> convert the existing codebase?
>

 I'm not happy with the idea of going back and converting old files, at
least not for any of those that I maintain. When I end up debugging code
that I maintain that has other people's commits sprinkled in, I often go
back and isolate them in order to to understand their effect on the
original code, and this gets very difficult when you have sweeping
whitespace changes.

FWIW, I don't actually interpret pep-8 quite as strongly as you do. It
seems more emphatic about not using tabs or 8 spaces, and it is all
prefixed with these very wise words[1]. In particular note the section on
consistency within files and projects being more important that adherence
to pep-8.

[1]
http://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds

Given the above section, I took the liberty of counting our de-facto
standard for both qpid and proton:

Qpid has 56.4KLOC in 188 files using 2 space indent and 44.8KLOC in 120
files using something other than 2 space indent
Proton has 18.2KLOC in 30 files using 2 space indent and 6.7KLOC in 30
files using something other than 2 space indent

Now I fully admit this is of course somewhat self fulfilling as a lot of
the original python code in both qpid and proton came from me, and my emacs
settings default to 2 spaces if it can't guess what indent the file is
using, but I would say the current defacto standard for qpid and a bit more
so for proton is tilted towards 2 space. That said, I'm not opposed to
using 4 space for new files, I'm just very much against changing existing
code unless the bulk of that code is also going to change for other reasons.

--Rafael

Reply via email to