J
Jyrgen
Hi
I have problems giving my structs good names, I usually name
them after what they are (of course) so if I have, say, a
window struct, I name it struct window, I usually don't bother
typedefing them. But now I can't use the window as variable name
(yes, I know I *can*, but I won't, I don't want to be confused
by using the same name for both struct and variable).
I can use the name w for the variable in functions that do
operations on the window, that works, but if I add a struct
widget, I don't want that to also have the name w in function.
I want to be consistent in my variable naming in the function
arguments, and it would be confusing to use w for both windows
and widgets. Of course I can just use wt or anything as a
variable name, but I thought maybe I should change the
name of the struct so that I can freely choose the names of
the variables.
Maybe prefixing or postfixing the structname, I've seen
names ending with _t for type, but that violates the standard,
right? Maybe _s is a good choice?
So what I'm asking for is your opinions on how I should name
things. I understand that there are many different styles and
tastes of this, and that I have to choose myself, but I'll
gladly take any opinions from you. I want to know if there is
any common or pouplar way to name things. Thank you!na
I have problems giving my structs good names, I usually name
them after what they are (of course) so if I have, say, a
window struct, I name it struct window, I usually don't bother
typedefing them. But now I can't use the window as variable name
(yes, I know I *can*, but I won't, I don't want to be confused
by using the same name for both struct and variable).
I can use the name w for the variable in functions that do
operations on the window, that works, but if I add a struct
widget, I don't want that to also have the name w in function.
I want to be consistent in my variable naming in the function
arguments, and it would be confusing to use w for both windows
and widgets. Of course I can just use wt or anything as a
variable name, but I thought maybe I should change the
name of the struct so that I can freely choose the names of
the variables.
Maybe prefixing or postfixing the structname, I've seen
names ending with _t for type, but that violates the standard,
right? Maybe _s is a good choice?
So what I'm asking for is your opinions on how I should name
things. I understand that there are many different styles and
tastes of this, and that I have to choose myself, but I'll
gladly take any opinions from you. I want to know if there is
any common or pouplar way to name things. Thank you!na