Imagine your dream, perfect, developer-focussed version of WordPress. What does it look like?
— Ryan McCue 🎄 (@rmccue) March 17, 2016
Ryan McCue pushed up a great monologue/question today on what would make WordPress more enjoyable to work with from a developer perspective. I’ve had several thoughts on this topic and figured the best way to share them is with a short blog post expanding on each of them.
Consistency in function naming
Function naming has evolved over the last 10 or so years, but there’s been no decided consistency which makes it particularly difficult to learn how to use which function when. I can use `get_the_title()` and `get_permalink()` out of the loop, but not `get_the_content()`? And on those functions, we have `get_the_title`, `get_the_content`, but not `get_the_permalink`? We expect people to memorize all these differences instead of fixing the core issue.
Clean up the spaghetti code
There needs to be a concerted effort to refactor a significant portion of the code in core. It’s a disorganized mess and finding anything in core can take a lot of time. It’s common for me to track down 4-5 files to find the source and code of a single set of functionality. This is a HUGE task and would take a year or more in an ideal world – the easiest way to approach it would be to rate the worst-offending files and address those on down the list. Eventually the code would be dramatically more logical.
Full separation of functional & display code
This goes along with the point above but deserves its own section. WordPress is FULL of admin files that have functions mixed in with display code which makes it a damn sight impossible to break down the code and make intelligent
REST API in core
The REST API landing in core and getting fleshed out will be a huge boon to making WP more developer friendly. It breaks you out of the shackles of using the WordPress templating system, which can be very frustrating to learn the first few times through. When a JS dev can jump in and build a WP frontend quickly, WP won’t be dreaded anymore.