Re: [Evolution-hackers] Evo-Plugin Coding Style

2010-07-01 Thread Christian Hilberg
On Thursday 01 Juli 2010 at 13:30:26 Tor Lillqvist wrote:
> > style. patch.shtml talks about 8-space-tabs
> Just some nitpicking here: I hate it when people say loosely that tabs
> correspond to 8 spaces (or four, or whatever).

For good reason. :-) Just quoted 
http://projects.gnome.org/evolution/patch.shtml ("Coding Style"), which may 
not be too accurate about this...?

> A TAB character indents
> to the next multiple of the tab width. The tab width is a certain
> number of columns. Exactly how many spaces that then corresponds to
> obviously depends on what the current column before the tab is.

Maybe the Evolution Patch Guidelines could use a little updating, if there is 
enough consent about how to deal with the nitpickable parts.

Greetings,

Christian

-- 
kernel concepts GbRTel: +49-271-771091-14
Sieghuetter Hauptweg 48Fax: +49-271-771091-19
D-57072 Siegen
http://www.kernelconcepts.de/


signature.asc
Description: This is a digitally signed message part.
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Evo-Plugin Coding Style

2010-07-01 Thread Matthew Barnes
On Thu, 2010-07-01 at 13:16 +0200, Christian Hilberg wrote:
> I'll  propose this as our style guide then. Just like Ross in one posting (I 
> think back in 2009), I'm interested specially in getting to know about indent 
> style. patch.shtml talks about 8-space-tabs (and true tabs instead of 
> blanks). 
> Since there are other Gnome projects (like Gimp) which do not allow tabs - 
> but 
> use blanks for all indentation, for purposes e.g. of alignment of parameters 
> in multi-lined function signatures - I wanted to be sure here that we follow 
> the proper Evolution-path.

I would side with Gimp on any new projects I start -- I hate tabs, and I
especially hate mixing spaces and tabs.  So our coding style is far from
what I would personally prefer but we're stuck with it and I adhere to
it for the most part.

I use spaces to align function parameters -- one parameter per line.
But I doubt you'll find much consistency here.

Because of my Python background I also prefer short, simple statements
using as many local variables as necessary.  And I try to avoid complex
expressions or nested calls in function calls.  It's easier to read and
easier to debug.

Also avoid one-letter variable names, especially in for-loops.  They're
very difficult to grep for.  e.g. Use something like 'ii' instead of 'i'
for simple integer counters.

That's all the pet-peeves I can think of off the top of my head.  :)


___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Evo-Plugin Coding Style

2010-07-01 Thread Tor Lillqvist
> style. patch.shtml talks about 8-space-tabs

Just some nitpicking here: I hate it when people say loosely that tabs
correspond to 8 spaces (or four, or whatever). A TAB character indents
to the next multiple of the tab width. The tab width is a certain
number of columns. Exactly how many spaces that then corresponds to
obviously depends on what the current column before the tab is.

I.e., for the traditional (and I mean *really* traditional) eight
column tab width, if a line has:

abcdef

*that* TAB character corresponds to *five* spaces. Not eight.

--tml
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Evo-Plugin Coding Style

2010-07-01 Thread Christian Hilberg
On Thursday 01 Juli 2010 at 13:01:22 Matthew Barnes wrote:
> On Thu, 2010-07-01 at 11:43 +0200, Christian Hilberg wrote:
> > searching evolution-hackers about Evolution coding style, I found
> > http://projects.gnome.org/evolution/patch.shtml
> [...] 
> That's still more or less valid.  There's details there I would nitpick
> but if you're writing your own module you have more freedom to do it the
> way -you- want.

I'll  propose this as our style guide then. Just like Ross in one posting (I 
think back in 2009), I'm interested specially in getting to know about indent 
style. patch.shtml talks about 8-space-tabs (and true tabs instead of blanks). 
Since there are other Gnome projects (like Gimp) which do not allow tabs - but 
use blanks for all indentation, for purposes e.g. of alignment of parameters 
in multi-lined function signatures - I wanted to be sure here that we follow 
the proper Evolution-path.

> If in doubt, look at code samples from evolution/shell, as that's all
> been rewritten recently and follows our preferred coding style these
> days.

Okay, thanks.

Best regards,

Christian

-- 
kernel concepts GbRTel: +49-271-771091-14
Sieghuetter Hauptweg 48Fax: +49-271-771091-19
D-57072 Siegen
http://www.kernelconcepts.de/


signature.asc
Description: This is a digitally signed message part.
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Evo-Plugin Coding Style

2010-07-01 Thread Matthew Barnes
On Thu, 2010-07-01 at 11:43 +0200, Christian Hilberg wrote:
> searching evolution-hackers about Evolution coding style, I found
> 
>   http://projects.gnome.org/evolution/patch.shtml
> 
> referenced as the coding style reference ;-) for Evolution. Is this document 
> still fully valid so we may use it as style guide for our project? Are there 
> any sections in this document which do no longer apply (e.g. Evolution moved 
> to C99 or something the like)?
> Thanks for any input on the issue.

That's still more or less valid.  There's details there I would nitpick
but if you're writing your own module you have more freedom to do it the
way -you- want.

If in doubt, look at code samples from evolution/shell, as that's all
been rewritten recently and follows our preferred coding style these
days.

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


[Evolution-hackers] Evo-Plugin Coding Style

2010-07-01 Thread Christian Hilberg
Hi all,

searching evolution-hackers about Evolution coding style, I found

http://projects.gnome.org/evolution/patch.shtml

referenced as the coding style reference ;-) for Evolution. Is this document 
still fully valid so we may use it as style guide for our project? Are there 
any sections in this document which do no longer apply (e.g. Evolution moved 
to C99 or something the like)?
Thanks for any input on the issue.

Greetings,

Christian

-- 
kernel concepts GbRTel: +49-271-771091-14
Sieghuetter Hauptweg 48Fax: +49-271-771091-19
D-57072 Siegen
http://www.kernelconcepts.de/


signature.asc
Description: This is a digitally signed message part.
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers