You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by Thorsten Schöning <ts...@am-soft.de> on 2014/02/18 15:30:19 UTC

Coding style

Hi all,

it's time to flame! ;-) Just kidding, but I would like to summarize
the already available suggestions:

> Tab: 4 space vs 2
> Insert spaces instead of tabs

I personally prefer tabs over spaces with a width of 4, line lengths
with around 100 or 125 chars, because of widescreen monitors, and
braces should go on the next line.

http://en.wikipedia.org/wiki/Indent_style#Allman_style

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Coding style

Posted by Florian Seydoux <fs...@apache.org>.
On 18.02.2014 15:30, Thorsten Schöning wrote:>
> I personally prefer tabs over spaces with a width of 4, line lengths
> with around 100 or 125 chars
<snip>

I'm personally totally schizophrenic: when writing the code, I prefer TB
(or elastic tab) without restriction regarding the line length,
to keep the semantic coming with the concept of a line of code.
But it's another story when debugging, or reading code written long time
ago, on -of course- another ide/editor!

On 18.02.2014 18:15, Rhys Ulerich wrote:
> That is my inclination.  Artistic Style is available as a binary
> download for Windows, OS X, and Linux and the configuration file is
> quite short

So yes, having one restyling tool like AS sounds good, to sanitize
further diff, merge and so on.


-- 
flo

Re: Coding style

Posted by Florian Seydoux <fs...@apache.org>.
On 18.02.2014 15:30, Thorsten Schöning wrote:>
> I personally prefer tabs over spaces with a width of 4, line lengths
> with around 100 or 125 chars
<snip>

I'm personally totally schizophrenic: when writing the code, I prefer TB
(or elastic tab) without restriction regarding the line length,
to keep the semantic coming with the concept of a line of code.
But it's another story when debugging, or reading code written long time
ago, on -of course- another ide/editor!

On 18.02.2014 18:15, Rhys Ulerich wrote:
> That is my inclination.  Artistic Style is available as a binary
> download for Windows, OS X, and Linux and the configuration file is
> quite short

So yes, having one restyling tool like AS sounds good, to sanitize
further diff, merge and so on.


-- 
flo


Re: Coding style

Posted by Rhys Ulerich <rh...@gmail.com>.
> Or do we only want one file for one tool as reference?

That is my inclination.  Artistic Style is available as a binary
download for Windows, OS X, and Linux and the configuration file is
quite short (e.g. [1]) and matches the manual [2] well

- Rhys

[1] https://github.com/RhysU/tuna/blob/master/astyle.rc
[2] http://astyle.sourceforge.net/astyle.html

Re: Coding style

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Rhys Ulerich,
am Dienstag, 18. Februar 2014 um 17:20 schrieben Sie:

> That said, I don't much care provided there's an Artistic Style
> configuration file[...]

Would we like to add those files to the repo? I'm using Eclipse
sometimes as IDE and it has a powerful formatter as well. We could
create a folder for such files for different tools. Or do we only want
one file for one tool as reference?

Besides that, I'm not a big fan of complete automated restyling of
code, in my opinion it's the people that should take care about
readability orienting on some common guidelines. There are always
some cases where people can format code better than tools and where
violating guidelines is acceptable.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Coding style

Posted by Rhys Ulerich <rh...@gmail.com>.
> it's time to flame! ;-)

Flame on!  1TBS, 4 space indent, nary a tab, and 80 column firm limit.
 I say this with 2 24" monitors in front of me.  I often debug by
printing and reading, and line wrapping is awful as is printing 125
characters per line to avoid it.  We could go Fortran and say 132
chars/line?  :P

That said, I don't much care provided there's an Artistic Style
configuration file that codifies what y'all decide so that it may be
used to automate formatting cleanups.  In particular, astyle can
enforce Allman.

- Rhys