← Back to team overview

yade-users team mailing list archive

Re: global renaming?

 

Bruno Chareyre said:     (by the date of Mon, 06 Nov 2006 16:16:49 +0100)

> >That will make the class names much shorter and more readable. Also
> >I'm in favour to switching into lowercase names with underscore. And
> >stop using CamelCase. Consider this class name for example, which
> >name is better:
> >
> >  InteractingMyTetrahedron2InteractingBox4InteractionOfMyTetrahedron
> >
> >or
> >
> >  big_4_spheres_AND_big_box_TO_ig_4x4_spheres
> >
> >  
> >
> 
> Well, it took me several minutes to understand the second convention 
> (and still not sure what 4x4 means)... so i'd prefer to stick with the 
> first one ;).
> Or if you want a simplest naming convention, why not :
> 
> big_spheres_AND_big_box_TO_ig_spheres
> 
> Is one information missing compared to 
> "big_4_spheres_AND_big_box_TO_ig_4x4_spheres"?


Good point Bruno!

So we will prohibit using numbers in class names. My intention was to
say that class has a name:

 big_four_spheres          - this geometrical model has four spheres

and 
 
 ig_four_by_four_spheres   - this interaction geometry is an
interaction between four and four spheres, making a 4x4 matrix with
16 elements. But we can pick a shorter name as well... maybe
"ig_between_four_spheres" or "ig_of_four_spheres", I think that
"ig_four_spheres" will be a confusing name, because it has 16
elements inside, not four.

I don't know what is better, please tell again if you like the
switch into those kind of naming:

big_four_spheres_AND_big_box_TO_ig_of_four_spheres

or

big_four_spheres_2_big_box_4_ig_of_four_spheres

or

BIG_FourSpheres_2_BIG_Box_4_IG_OfFourSpheres

(I don't like mixing underscore with CamelCase)

or

BIGFourSpheres_2_BIGBox_4_IGOfFourSpheres

(only underscore at _2_ and _4_)

BIGFourSpheres_AND_BIGBox_TO_IGOfFourSpheres

BIGFourSpheresANDBIGBoxTOIGOfFourSpheres


Or maybe you prefer to stay with the old naming convention? I really
don't know...

my motivation for such renaming:

 - using underscore is helpful with wery long names. Because a name
longer than 20 characters without a single space inside is difficult
to read.

 - so if we decided that using underscores is helpful and want to use
them, then we should be consequent about that, and use them
everywhere instead of CamelCase, otherwise people will not know
whether they should use _ or big letter. And will have to look it up
in the particular class name.

 - the C++ standard library std:: and widely used in yade boost::
libraries use underscore in their naming. So we become a 'little more
standard' :>

 - and the idea to use bgm_ big_ ig_, etc is just to have shorter
class names.



The problem is that bgm_ ig_, etc prefixes conflict with CamelCase
convention, like in this class name:

BIGFourSpheres

is it "BIG" or "BIGF" ?


big_FourSpheres

with underscore, and rest is CamelCase ? That will be confusing,
because someone unfamiliar will not know where to expect underscore
and where not expect it.

So how do you think?


-- 
# Janek Kozicki
_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-users



Follow ups

References