[GRASS-dev] GRASS C function names

Soeren Gebbert soerengebbert at gmx.de
Mon Aug 7 06:45:18 EDT 2006


Dear devs,
i have a question about the function naming guidline of GRASS.
I would like to add a guidline to the SUBMITTING file.

But the problem is that we have two naming conventions
for library functions  in GRASS.
The common convention is: G_fatal_error(), to place a "_" between the function description strings,
but within the G3D library a different convention was used: G3d_fatalError().

Personally i like the function name convention of the G3D lib, because this 
convention is used in other libraries i am programming with and i think its better readable. 
So i named all the functions in my r3.* modules like the G3D lib standard.

But i would like to see a uniform programming standard/API within GRASS, so what to do?

Should the G3D library API be an exception and all the user defined function names should use
the common API (G_name_name), or should the module developer decide on his own what convention to use?

Or should we/i rename all G3D function names to meet the common convention?
Well thats not impossible, but a huge amount of work (the testing and the docs).

In my opinion a function naming guidline is important, like the coding standards of VTK:
http://www.vtk.org/Wiki/VTK_Coding_Standards

Also a clear guidline how to name a module (not more than 2 dots in name?) and how to name 
the command line variables would be helpful.

What do you think?

Best regards
Soeren




More information about the grass-dev mailing list