So… My friend and I are making a game that has specific classes with specific skill sets… Almost like how Diablo has the Barbarian class, etc… So, we went to develop it and we ran into a bit of a quirky problem about naming conventions… We want to have a base script for our classes that the actual (say, Barbarian) class will inherit from… But we don’t want to name is classClass, or BaseClass, because, well… That looks weird lol. It isn’t very descriptive because a class in c# is obviously not the type of class I am trying to define with the name lol. I know this isn’t really a question, but rather just a funny naming convention quirk… I’m wondering if any other developers have went through this before? If so, what did you decide to name the base class? We ended up just going with BaseClass and hoping any future developers don’t get confused… Obviously they can read the comments at the top and will immediately be aware of what the purpose is and true name of the class is supposed to mean… But until they do, I’m sure we are going to look like some pretty poor programmers to them lol.
BaseClass is actually fine in my mind
CharacterClass
PlayerClass
Haha, I was editing while you were replying. We actually went with BaseClass, but the other ones you mentioned sound a little more descriptive… I’m just imagining myself coming into a team and not knowing anything about their code, and all of a sudden coming accross a class named “BaseClass”… I would be baffled, at least until I actually read the code inside of the class… Then I would probably facepalm. xP
Hang around software development long enough and you’ll see far worse…
Oh, I’ve seen a bit… I’m sure I haven’t seen it ALL… But I can recall one time… I downloaded a library where someone was (i guess) trying to obfuscate their code… Almost every method was named CQCQFOBCQ or some variation of the sort… In the long run, though, it worked… Because I gave up trying to pick through his code lol.
Here we would do
CharacterBase or AbstractCharacter
Character or CharacterImpl
Player
It’s definitely pointless to put “Class” in a class name. I know Microsoft suggests putting a capital i in front of all interfaces (Eg: IEnumerator) but that seems just as bad as Hungarian notation.
What I can say is that every team is different, and usually in a team people will start to use the same conventions so we can all communicate with each other. Use whatever you think will make the most sense to the rest of your team. =)