20414, "bradcray", "Rename 'object' root class?", "2022-08-09T21:45:22Z"
A discussion in Memory.Initialization: explicitDeinit function signature · Issue #20322 · chapel-lang/chapel · GitHub led to a few observations about the name of the abstract object class (which is the root class that all other classes inherit from — e.g., class C { ... } is effectively class C: object { ... }).
- it uses lowercase
owhereas our convention is to use uppercase names for classes (so maybe it should beObject?) - our documentation tends to refer to records as also being a form of 'object', so using this name in this way may suggest that class variables are objects and record variables are not (at least, @mppf made an argument like that on #20322)
- [speaking for myself, I tend to think of objects as "things that have fields and methods" and sometimes more generally as "things that have initializers and deinitializers", which is why I tend to think of both records and classes as being objects, and why I think our documentation reflects that terminology currently].
- Michael notes that
objectorObjectis a typical name for this thing in many languages. But I pointed out that we may not want or need to follow that precedent given that we have both classes and records in Chapel (whereas most OOP languages would only have one of the two)
- we find we don't use
objectmuch in practice in Chapel, perhaps because generics or records are often used rather than pure class hierarchy-based OOP (?) (so renaming it at this point would probably not be terribly disruptive to most deployed codes)
So, some possible actions we could take here:
Option 0: Leave things as-is
- mmmaybe acceptable given the rarity of use, but seems unfortunate given the observations above
Option 1: Rename object to Object
- seems like the least we should do
- and maybe what we should do if others don't believe records should be described as objects—in which case we should update our documentation and the way some of us talk about them
Option 2: Rename object to something else — but what?
a) Class? Somewhat symmetrical to our use of class as an 'any class'-style generic typeclass
b) ClassObject? Maybe somewhat more specific / less confusing than just using Class or Object?
c) RootClass?
d) AbstractClass?
e) something else? What?