Archived

This topic is now archived and is closed to further replies.

doctorsixstring

Name for a class

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites