WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm just getting started learning about the WordPress Core. WordPress's codebase is the first large codebase that I've looked thoroughly into.

The get_posts method in wp-includes/query.php is 1300 lines long. To me that is huge. Can I expect a lot more of these large functions in the codebase?

share|improve this question
    
yes that's huge, another one that comes to mind is redirect_canonical() with few hundred loc. – birgire 8 hours ago

Yes.

To give you some historical perspective WordPress core:

  • is relatively old code base, code volume tends to grow over time;
  • has extreme commitment to backwards compatibility, as result it's extremely rare for code to be removed from core;
  • is written in essentially obsolete dialect of PHP version 5.2 (which it remains compatible with), which resulted in monolithic core design and low separation between modules;
  • largely ignores code length and complexity metrics for the purposes of development and maintenance.

You don't make it completely clear if you are interested in PHP development in general or WordPress specifically. If you want some experience with modern PHP development style you should probably look at different projects, done in more current styles.

share|improve this answer
    
Drupal 8 is a great choice of framework to learn modern PHP development styles. – dotancohen 8 hours ago
    
Ok! I'm learning wordpress development, plugins and themes, just curious of the inner workings. Clients seem to like wordpress as their cms. – Larry Lawless 8 hours ago
    
@LarryLawless You don't have to know how Wordpress works internally to develop for it, you just have to know where to find API documentation. You can drive a car without the ability to build one yourself. – gronostaj 1 hour ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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