On Wed, 2009-08-05 at 00:48 -0400, Yuval Levy wrote:
> * if you're not interested in Hugin's development, you can stop reading now*
> 
> Hello Hugin developers,
> 
> I've been looking at our source code and I find that it can use some 
> consistency / clean up. The current status is historically grown - I am 
> not sure every contributor has seen Pablo's notes [0] and I think our 
> coding style belongs on the web, maybe on a wiki page?
> 
<Snip>
> 
> 1.2. VARIABLE NAMES
> 
> some variables are named with the CamelCase convention - capitalizing 
> the beginning of the word. Other use the word_separated_by_underscore 
> convention. Are there other conventions? Which one do you favor?

I think the first letter of a name should be capitalised only for
classes, structs, and typedefs. Variables and functions should not have
an initial capital.
This is especially useful when you want to declare a variable with the
same name as its class, as you don't need to name your variable
ThePanorama or MyPanorama or similar.
I favour the_underscore_convention but since most of the names in Hugin
use camelCase it is probably best we stick with that.

> variable names should be clear and descriptive. no contractions, maybe 
> with a few listed exception, e.g. Pano instead of Panorama. Any more 
> exceptions?

If we allow exceptions, the contracted form of the exceptions should
always be used, otherwise the rule doesn't help very much.

> 2.2. WORK IN PROGRESS
> 
> if something needs work, put a // FIXME or // TODO comment so that a 
> grep will reveal places that needs attention. Gedit automatically 
> highlights TODO and FIXME.

gedit does highlight them, which is useful. It also highlights doxygen
commands. The @todo and @bug sections in doxygen comments are listed
here:
http://hugin.sourceforge.net/docs/html/todo.shtml
http://hugin.sourceforge.net/docs/html/bug.shtml
as well as inside the relevant documentation. This is arguably more
useful, especially when using a different editor.

> 3. SPACING AND INDENTATION
> 
> 3.1. BRACES
> 
> there are many different indent styles [3].
<snip>
>  Which one do you prefer?

I prefer Allman style too.

> 3.2. TABULATORS
> 
> use spaces instead of tabulators (to maintain consistency across 
> editors). use four spaces for one indentation. or are there other 
> preferences?

This is fine.

I'll repeat Bruno's comment as it is important:

Don't start changing existing code until all the branches we are working
on have been merged with the trunk.

James


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx
-~----------~----~----~----~------~----~------~--~---

Reply via email to