Re: Variable Naming convetions...



Dnia 01-05-2005, nie o godzinie 20:43 -0700, email micahcarrick com
napisał:
> Since I'm new to GTK+ programming, I would like to use conventional
> variable naming if at all possible.  I've read that functions are in the
> format..
> 
> some_function_name()
> 
> and objects are...
> 
> ThisIsSomeWidget
> 
> and regular variables are...
> 
> this_variable_is_like_a_function
>
> Is this correct?

If by ThisIsSomeWidget you mean type name, then yes, it's correct. If
this is object instance, however, then you'd rather follow normal
variable naming, like

GtkWidget* main_window;

Also, for enums and macros you use all caps, like 

enum 
{ 
GTK_SOME_ENUM_VALUE
} GTK_SOME_ENUM;

#define GTK_SOME_MACRO

unless the macro is intended to be used like normal function, in which
case you use function naming convention.

Cheers,
Maciej

-- 
Maciej Katafiasz <ml mathrick org>




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