Define consistent specific naming to refer to the different types of types #11078
Replies: 2 comments
-
I'm generally in favor of this kind of terminology standardization, but this seems like a lot of types of types to add specific terms for. How many of these groupings need to be referenced often in the docs? Some of the groups, like "bounding types", seem like they can be spelled out instead as "Rect2, Rect2i or AABB". IMO the way to approach a problem like this is start with existing groupings that are mentioned often, and do not have an official term. Or look for terms that are already used, but inconsistently. |
Beta Was this translation helpful? Give feedback.
-
I sympathize with you on the inconsistent usage of "type" across the class reference, but I feel like the suggestions are overly thought-out. "Object types", which should probably be "classes", are biggest offender, as not only it is inconsistent across the documentation, but also in the editor ("Node type" comes to mind). Similarly, the concept of inheritance is also explained inconsistently and is potentially confusingly. Terms like "child class", "parent class", "object-derived", "inheriting", "inherited", etc. are used all over the class reference. Sidenote, since you're spending the effort to categorise all Variant types, see also: |
Beta Was this translation helpful? Give feedback.
-
I don't really like the term "Variant types", it's quite confusing. One could think: if everything can be a variant, isn't every type a "variant type"? Does "variant type" include objects or not? Does it include
Variant
itself too? IMO it would be clearer if Godot would consistently use "basic types" instead.The term "class" can sometimes also be unclear if it refers only to
Object
and its subclasses or to everything.Maybe it's a nitpick, but it might be a good idea to have specific meta-type term definitions like these for consistent and non-confusing naming across docs, etc. Also to categorize so one can refer to specific groups of related types together with a simple term. I thought I'd try listing suggestions here (all up for discussion).
This hierarchy could facilitate thinking about what should go where if making changes to the typing system of the engine.
So, this is how I see the Godot/GDScript type system in my head, and the terms I think fit best.
Variant
itself;"variant kind" could refer to the
TYPE_*
tag of a variant data structureObject
and its sub-typesObject
and sub-types, excluding scriptsNil
and:bool
,int
,float
String
Color
and the "spatial types":Vector*
Rect*
,AABB
Quaternion
,Basis
,Transform*
,Plane
,Projection
RID
StringName
andNodePath
Callable
,Signal
Packed*Array
,Array
,Dictionary
,Array[T]
,Dictionary[T]
;all others (except
Variant
) are "atomic types"void
int
at runtime)Some terms in addition to the hierarchy before:
Array[T]
,Dictionary[K, V]
, etc.Array[Quaternion]
,Dictionary[int, Node]
int
,float
and dimensional typesString
and designatory typesBeta Was this translation helpful? Give feedback.
All reactions