Name for a class

Started by
6 comments, last by doctorsixstring 21 years, 2 months ago
In my space RPG, characters, factions, etc. will all have limited knowledge of/attitudes towards other characters, factions, ships, planets, etc. What I want to do is have a class that characters, factions, etc. can derive from which would enable them all to be stored in a "knowledge list". This class, then, would represent any object about which other objects have an attitude towards, or have knowledge of (it will probably be used for both functions). I want to see some of the names my fellow forum-dwellers can come up with. If anyone needs further clarification as to what I mean, by all means ask! I really want to think of a good, descriptive name for this class. Thanks! -Mike
Advertisement
What about the class name "Knowable". E.g. a character is knowable since it can be known by others.


Jacob Marner, M.Sc.
Console Programmer, Deadline Games
Jacob Marner, M.Sc.Console Programmer, Deadline Games
Excellent! I''m surprised I didn''t think about that. I think I will use Knowable (unless anyone else has an even better suggestion). Thanks felonius!

-Mike
I''m just glad someone didn''t suggest CKnowable, I see this type of class naming in code all the time and it makes me cough the word "newbie" every time.
quote:Original post by Pseudo
I''m just glad someone didn''t suggest CKnowable, I see this type of class naming in code all the time and it makes me cough the word "newbie" every time.


If by "newbie" you mean "Microsoft".

Personally, I prefix all of my important classes with an ''X'' just so the IDE sorts them all together and differentiates them from other, more trivial classes. (actually, anything I derive from MFC I prefix with a ''C'' just to maintain consistency).

Maybe I''m just weird, tho.

quote:Original post by Pseudo
I''m just glad someone didn''t suggest CKnowable, I see this type of class naming in code all the time and it makes me cough the word "newbie" every time.


Seriously eh?

Who the fuck would want to keep track of classes and things, so they don''t go confusing them with structs or even arrays?

Yeah thats totally moronic.

Lets just use "X" and "I" and "Y" and "J" for all our variable names too, might as well since we''re ditching any notation at all.

AP: there are different naming conventions around.
I don''t see any need to distinguish classes from structs since they''re equivalent in C++ anyway (ok, except for default visibility which is set to "public" for structs).

Take a look at the STL for instance - you won''t find any CFoo name there. You cane use suffixes, prefixes, mixed-case, and anything you can possibly image. As long as it''s consistent and
variable names aren''t too cryptic, it''s fine with me.

Also keep in mind that there''s a difference between an important public API like the win32 one and user programs.
Hungarian notation is good for API and library programmers but I wouldn''t use it for my own projects. One reason is - I can easily distinguish API related stuff from my own code

Regards,
Pat
yada yada yada
and so the same old argument begins again. It''s like asking what colour t-shirt you would rather wear.

This topic is closed to new replies.

Advertisement