So you go to mediawiki.org, and you'll eventually end up on this stupidly named page which explains almost nothing about actual development. After a lot more looking, you'll eventually find this. Now THIS is the real deal! Right? Wrong. Their "documentation" is just an automatically list of comments in their code. In fact, it's so useless, you will be better off just ignoring it completely and just grepping things on your own machine.
Now let's get to their actual code, it's the most unreadable mess I have seen. And believe me I have seen unreadable code.
Refactorization (or lack their of)
To understand why it's so bad, you need to understand a little bit about programming: Overtime, code will be reshuffled and modified as it is written and to meet changing needs. Unfortunately, since the original code was designed for different conditions, the new code will be generally inferior in quality to if it was written from scratch. This is known as "code debt". Usually this is solved via a process known as "refactorization", where some or all of the code is rewritten.
Now let me explain what the WMF does: They never refactorize code, instead they "defactorize" it. They take the original broken code and brake it more by splitting into tiny parts and distributing those parts across several files.
Deprecation
Now let's talk about the next major problem: Deprecation. Usually deprecation is done when all the functions of some set of old code is now preformed by a new set of code and this new set of code is exclusively used internally. The old code remains, but it is only accessible externally and is only their for backwards compatibility as all new code should be using the new interface or functions.
That's not what the WMF does, instead they "deprecate" code that is currently in use with "plans" to write an alternative. Of course, these "plans" never come to fruition and ten years later, the "deprecated" version is the de-facto one to use. This often leads to "reprecation" where the "deprecated" function increases in usage, while the new version is de-facto deprecated.
Here's an example: To create a user you would think that you would go to the user class and create one. And you can do that. But it's deprecated. Because some idiot came up with the "brilliant" idea of defactorizing the creation process to its own class. And these people have the NERVE to claim that "object-oriented programming models the real world" NO IT DOESN'T! Especially not this. Want to know what idiot did this? None other than "MediaWiki developer" DannyS712. This is the kind of "development" he does.
Actually attempting to write code
Even finding a function to do something is insanely difficult. First thing, there is a 99.99% chance that there is no real documentation or tutorial (even if it is something basic). Second, attempting to search for the thing you need will lead to many things that aren't what you want. Your typical search results will look like this:
- Something completely unrelated that just happens to have a word in it that matches your search result.
- An API for the thing you want to do (likely not what you actually need).
- Something with the same name as what you need (but actually does something entirely different).
- A function that was deprecated in 2005 (made worse by the fact that sometimes that is actually what you need).
- The thing you actually need (if you get lucky).
The "best" strategy
The best strategy to find something is not to directly look for it. But to think of something else that probably uses it and copy that thing's implementation. It's basically like reverse engineering. Now that I think about it, maybe I was wrong to call that article in the beginning "stupidly named". Most of hacking is reverse engineering, and so is most of MediaWiki development.
Occasionally (very very occasionally), there will be a guide on mediawiki.org for what you want. Unfortunately, the guide will probably only contain the very basics of what you need, be missing large amounts of essential steps, can several major errors, and still won't work anyway because it was last updated in 2009 and everything in it was removed ten years ago.
Because of all of this, it will take hours, possibly even days, to do even the simplest operations. There isn't a learning curve either, because there isn't any learning, just trial and error.
How do WMF developers deal with it?
I don't know, but my theory is that they don't. They probably do the same stuff as the rest of us. That's probably why their development takes so long and why they're always yearning to use anything other than their own software. After all, if it takes hours just to write a few lines of code, it makes sense that it would take months, years, or even decades to do anything substantial.