Template talk:CDA

From Valve Developer Community
(Redirected from Template talk:CD)
Jump to: navigation, search

Hierarchy Order

Reverted your edit on player (L4D2) inverted class hierarchy. The first thing people look at is the first line in a list so it being the current entity class makes most sense and is more practical. Reading CBaseEntity everytime as a first thing isn't practical since obviously every entity is CBaseEntity. --Nescius (talk) 15:08, 1 November 2022 (PDT)

The arrows' orientation and the indentation heavily suggest that the lower right one inherits from the upper left one. If you see CCSPlayerCBasePlayer, are you sure that you would think that CBasePlayer is the parent class? Like in tree graphs, it is more intuitive if parents are further up and children further down. In addition, arrows would point from parent to child, not the other way around. If you ask me, letting the reader get the hierarchy order right is more important than reading the classname that a page is about at the very top of the hierarchy box. --Popcorn (talk) 17:30, 1 November 2022 (PDT)
The arrows go from more specific to the less on the hierarchies I found on google too example. A -> B is supposed to mean A inherits from B. Maybe can rename the box to class diagram as the template name CD implies or class inheritance. But one thing that certainly should remain is current entity class being at the top. I don't think getting the order wrong can really happen. Everyone should realize what the order is by seeing CBaseEntity at the end --Nescius (talk) 22:44, 1 November 2022 (PDT)
Hm. Ok, both orientations for the arrows are reasonable. But interestingly, even in your example the root parent class is at the top, not at the bottom. I'd suggest CBaseEntity↖ CTerrorPlayer due to the fact that this way CBaseEntity is the closest to the left base (and top base), being the base entity. I don't think it is too practical to read the current class first, in fact it would even have the disadvantage that if you click through the classes in the hierarchy box, the positions of the classnames will always change. If the order was reversed (CBaseEntity at the top) and if there was a good minimal width for the box, then ideally, clicking on the link of some parent class would keep the position of all super parent classes. I think this convenience is worth more than reading the current class first instead of last. --Popcorn (talk) 08:26, 2 November 2022 (PDT)
In the example it's showing diagram of all classes so it makes sense to go from the most generic one. So if we want to see what inherits from CBaseEntity it makes sense to put it first like this. But in case of entities we are starting at one specific one. So that one should be the first and the rest goes down from it. Even when searching these inheritances in available source code first thing you look for is for example CTriggerMultiple and next to it is : CBaseTrigger. Then you check CBaseTrigger and see : CBaseToggle etc. Same when checking NetProps dumps the types go from most specific to less. CBaseEntity being the first thing to read there on every entity page doesn't make sense. Also the current entity class being first there can make the Template:code class pretty much obsolete if also the file name is included (not that this wouldn't be the case with it being the last but it doesn't look that good) --Nescius (talk) 11:36, 2 November 2022 (PDT)