Re: Are underscores significant to THtml?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Dec 01 1998 - 10:37:34 MET


Hi Nick,
The THtml class is currently looking for underscores in the file name
corresponding to a given class name. If a file name has the
form XXX_yyy.cxx, THtml adds this class to the folder/index XXX.
This is independent of the class name having itself underscores.
There are certainly better ways of associating automatically
a class to a given folder. We selected this algorithm because
it matches nicely our development environment.
You cannot disable this feature in the existing version.
Ideas are welcome for better algorithms.

Concerning your points about "other assumptions"
Root does not make assumptions about naming conventions in general.
We must support all possible programming styles.
There is one small place, however, where we make an assumption:
If a class member function is declared with a comment field // *MENU*,
this function will be inserted in the list of items of the
context menu when you click on an object with the right mouse button.
If this function has parameters (mandatory and/or optional), a
dialog box is shown. To pick the current and default argument values
Root looks for data members of the style fXXXX or m_XXXX for
arguments named XXXX (upper/lower case supported). If no-match is found
Root looks for a possible GetXXXX function returning the current
value of XXXX. If no-match is found, no luck, the dialog box
will not show a default/current value for the parameter.
In short, if your data members are named fXXXX or m_XXXX
or your Getters/Setters are named GetXXXX/SetXXXX, Root will be able
to do a bit better in the GUI.
It is my "personal view" that one should avoid underscores in
the names (classes, functions or data members).

Rene Brun


Nick West wrote:
> 
> Dear roottalk,
> 
> I need some help with THtml. Although it works just fine for most of our MINOS
> code, it does crazy things with the index for one category of classes.  The
> members of the category all have the prefix REROOT_ and THtml creates the
> index:-
> 
>     REROOT_REROOT_Index.html
> 
> but fails to fill it, claiming that it knows nothing of any of its classes.
> Looking at the code of THtml, it seems clear that it is the underscore that is
> the problem and that THtml is making assumptions about its presence in the name.
> Now I know that underscore is deprecated (Taligent Name conventions) but haven't
> found anywhere in the THtml or the coding style documents that this is a
> prohibition.  If my analysis is wrong, can anyone suggest what I am doing wrong?
> If my analysis is right are there any other rules that the unwary can
> transgress?  In particular some of our code draws on earlier STL supported work
> and we have followed designs from both ATLAS and ALICE which has influenced our
> choice of names.  Naming conventions are without doubt essential but, they are
> also arbitrary.  For example, using m_Variable rather than fVariable for data
> members and Variable() instead of GetVariable() for getters.  So whilst it is
> true that ROOT is a framework rather than a library, how far does it go in
> dictating a naming convention and what happens when trying to integrate software
> that has been developed outside of ROOT that conflicts with this convention?
> 
> Cheers,
> 
> Nick West.



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:40 MET