I am pretty new in WordPress and PHP development (I came from Java and C#) and I am a bit
astonished about how WP is structured.

Coming from Java and C# I'm used to work on totally object oriented architectures and now, working on WP, it seems to me that it is not totaly object oriented.

For example the function.php file ino every theme is not a class but is a simple php file containing some functions, so it respect the old procedural model.

At the same time it seems to me that WP don't use MVC pattern

My question is: why WordPress (that is a modern CMS) don't use a totally Object Oriented paradigm and don't adopt the MVC model?

closed as primarily opinion-based by Stephen Harris, Tom J Nowell Aug 14 '14 at 15:07

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • It's an important & good question, but I'm afraid this isn't the place for it. I'm fairly certain all of the core team will be on the wp-hackers mailing list, so I think trying there might be better. – Stephen Harris Aug 14 '14 at 14:51
  • 2
    One view: Gloves aren't for feet. (Also read the first comment on that article.) – Pat J Aug 14 '14 at 14:54
  • WordPress isn't a modern CMS, it's a legacy CMS that sees active and continued development. Sadly the only person who can accurately answer this has been gone so long that when he was last around WordPress hadn't been founded ( b2 maintainer ) – Tom J Nowell Aug 14 '14 at 15:07
  • Failing that, Matt Mullenweg or Mike Little may be the next best able people to answer this, both of which are available via twitter – Tom J Nowell Aug 14 '14 at 15:08

WordPress as a project has extreme commitment to backwards compatibility. Whatever new things you add the old things need to work still. Whatever things you change still need to work in old way as well.

So regardless of how WP started as non–MVC application, it cannot become one without retaining all of its non–MVC ways. Which makes it pretty pointless direction.

Coming from formal background MVC might seem like a baseline and "naturally" preferable way to organize. Coming from self–taught background (or lack of programming background entirely) it's mostly overblown abstraction which even people who like it cannot agree on.

WordPress largely targets users, not developers. Any complicating of the learning curve will just be shooting its strong sides for little gain.

  • Interesting point of view – AndreaNobili Aug 14 '14 at 17:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.