I'm unsure whether this post is allowed, considering it may be subjective. However, I have seen many posts concerning naming conventions (on programmers, as well as on StackOverflow - where I'm a more active member) so I think it should be valid. (Though it seems that sometimes topic with naming conventions are quickly closed and sometimes they aren't, so we'll see.)I'm currently working on a JAVA project, though the problem would arise in basically any functional language. In my programme, I create a fictional world. This means that I'd like to create characters, objects, entities, and what not, with many classes extending the other. For example: entity would be a super class which only knows whether an element is moveable or not, and where it's currently located (i.e. its coordinates). In another class, this could be refined to characters that also contain a name and a gender. Another class would then distinguish as objects, in that they could hold a type (e.g. tree, car and so on). For this latter type, it seems overhead to create Class for each type, considering there are many possible types in the world, with which I mean typical objects in the world, not further defined by any hierarchy.Starting from Entity as a class, I'd go down to Character and Object classes. However, I've been told a couple of times that I definitely should not use Character and Object as name classes, because they are inherent to Java's collections. The question I ask then is:Shouldn't we do so, because it's confusing for us as a programmer, or does it have programmatical consequences?Is this discouraged in all programming languages? Or are there any languages in which this isn't such a big deal?My IDE (Eclipse) doesn't throw any errors, not even a warning - so is it really that big of a deal?Are there any conventions to represent persons, or objects (the referents in the real world) with a class name? For the life of me, I can't figure out a good synonym for Object. Character can be replaced by Person I guess, but for Object it's much harder.I wouldn't want this question to get labelled as not a real question or subjective because of that last question. My main questions are 1 & 2 & 3. An answer on 3 is optional, and could also be posted as a comment. It's the one I'm least interested in.
Super classes that represent a wordly hierarchy: naming conventions
java;naming
It is not a problem in a language with different namespaces as java, it may be confusing thought.Same as 1.Same as 2.A real problem would arise only in languages with a global namespace for some kind of objects, as function in C: in C functions are all in the same global namespace and are not overloadable, so you can not declare two functions with the same name or there would no way to distinguish between the two versions. It is for this problem that usually libraries use some prefix/suffix.In Java there is no problem if they are in different namespaces: if there is a conflict in names you can always use the full name. 