Forum:Consolidating related API

From Wowpedia
Jump to: navigation, search
Forums: Village pump → Consolidating related API


Currently it is standard practice to make a separate page for every WoW API function, but in a few cases this pattern has been broken. For example:

How far should we go with this? I personally think these examples make tons of sense, because they are so closely related that anyone interested in one should see all at once.

But here's a list of pages that are currently broken apart... does it make sense to merge them or keep them apart? Why? (To be clear, I don't necessarily advocate merging all of these... I'm trying to stir conversation with lots of examples good or bad.)

I'll go on a limb and say the last example (size and position) is proof that its possible to take merging too far. That would be complicated to put all under one roof!

But would the last example make sense if you merged it those articles into four pages like this?

  • SetWidth, SetHeight, SetSize
  • GetHeight, GetWidth
  • GetRect, GetScaledRect
  • GetLeft, GetBottom, GetRight, GetTop (this merged page already exists)

--DDC (talk) 00:27, 9 March 2020 (UTC)

Thinking about this some more, I think it would make sense to merge api functions if they meets all or most of the following criteria:
  • The functions are part of the same table or system (such as C_Timer or Frame)
  • The functions are closely interchangable (UnitAura and UnitBuff) or direct opposites (Show and Hide)
  • The functions share common arguments or returns (many examples)
  • The functions are in fact extensions of each other (C_Timer.NewTicker extends C_Timer.After, and Region:IsVisible extends Region:IsShown)
  • The functions are equally related to each other, and not to any others (GetRect, GetScaledRect; then GetLeft, GetRight, GetBottom, GetTop; and then GetWidth, GetHeight)
  • The pre-merged pages did not exist (GetRect()) or were out of date (Show/Hide) or didn't tell the whole story (C_Timer before a week ago); ie, these pages were due for an update anyways
DDC (talk) 03:46, 9 March 2020 (UTC)
I agree at least with consolidating functions which share common arguments/returns and closely related api like GetLeft, GetRight, GetBottom, GetTop Ketho (talk) 21:54, 9 March 2020 (UTC)
As an example, I just created Region:GetRect() and Region:GetScaledRect() as a merged page but then separately made GetUnscaledFrameRect(frame,scale) because: (a) its arguments are different, and (b) it's not part of the Region table. DDC (talk) 02:48, 10 March 2020 (UTC)