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.
Thing
,Item
,WorldObject
pops up in my mind; having a class called Object is akin to redefiningfalse
totrue
(e.g. in python)