glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] coding guidlines


From: Stephane Magnenat
Subject: Re: [glob2-devel] coding guidlines
Date: Mon, 20 Oct 2008 14:44:38 +0200 (CEST)
User-agent: SquirrelMail/1.4.9a

Hi,

> what do you think about the following guidlines?
> - one class per file (i've seen files with 5900 lines.)

I do not like this convention if it is applied strictly. In some case, it
is reasonable to have several small classes related together in a single
source file, not speaking about inner classes.

I would prefer a more semantic-oriented and not so syntactic-oriented
convention, so as "each file should contain a single logical element that
could be conceptually represented as a box in a architecture schema at a
specific level of detail."

> - a folder hirarchy reflecting the namespace usage.

You mean, for glob2/usl/libgag instead of the src/header directories? I
agree that separating src and headers was a bad idea.

However, I think that we should not create too much directories, because
it makes fast searching more complex (a single grep is not sufficient
anymore) and fast choice of files to load more complex as well. Currently,
it is very convenient to display all .h or all .cpp files with kwrite and
just load whatever one need, for instance. We should not make this more
complicated when there is no sound reasons to do so.

> - every public attribute has to be commented (use /// or /** */ so doxygen
> works) even when the name is speaking so the comment is nothing more than
> this name.

Why not. But again, sometimes it is much more important to write a small
description of the class then a dumb documentation of all of its members.
Of course the two are not contradictory.

Have a nice day,

Steph





reply via email to

[Prev in Thread] Current Thread [Next in Thread]