Pity it's so widely used, and there's little competition...
There's still plenty of warts, of course, but that seems true of just about every widely used piece of software -- bad decisions early on in development become very hard to walk back later when any of millions of sites/themes/plugins/etc. could turn out to be depending on that bad decision being there...
http://trends.builtwith.com/cms provides some good trends of the big players, but I wouldn't put too much stock in it.
That said, as a developer who has fallen into the WordPress business out of necessity, there are a lot of great products out there that are built much better than WordPress and I wish one of them were the dominant player. Still, WP manages to get the job done most of the time.
Honest question: Can you name one?
I'm seriously looking for a WordPress alternative, but I haven't found one that is truly BETTER.
Sticking with PHP, both http://modx.com/ and http://www.silverstripe.org/ are fairly popular and well-built. I've also heard good things of http://www.concrete5.org/ , http://www.movabletype.com/ , http://textpattern.com/ , and http://ellislab.com/expressionengine . http://habariproject.org/en/ has also been built specifically to address many of the faults in WordPress and other popular systems.
{get $blogs from "/channels/blogs/entries"}
...
Alpha version was released just yesterday, you can sign up and download it at http://getfwd.com/shameless plug
# controllers/BlogController.php
class BlogController extends AppController
{
function index ()
{
$this->entries = get("/channels/blogs/entries");
}
}
# templates/blog/index.html
{foreach $entries as $blog}
...
{/foreach}
Or, as in my example, this... # templates/blog.html
{get $entries from "/channels/blogs/entries"}
{foreach $entries as $blog}
...
{/foreach}
I've written substantial apps both ways, and so far I have found that powerful templates are actually easier to write, read, and maintain, perhaps because the entire request flow happens in a single file.I doubt Wordpress would be used for anything other than simple blogs if it weren't for querying from templates.
Obviously there is the risk of theme developers loading tons of queries from a template but I think trying to prevent that would be premature optimization. The benefit of greater customizability outweighs the potential performance hit IMO.
The template pseudo languages enforce a strict separation between model and view, and they typically do so with a much more concise syntax and legible format compared with embedding PHP in HTML, for example.
I used to prefer general languages for templating, but once I learned the pattern of using Twig to the full I found that I could create templates much faster than before, and I could also go back to a template after a couple months of not looking at it and quickly understand what I was looking at.
That leads to all sorts of debugging fun when something weird is happening, and opens up naïve users who assume that a "theme" is somehow safer than a "plugin" (because all themes do is change the look and feel, right?) to security risks from downloaded or hacked-up themes.
So much of programming is protecting the programmer from him or herself. By enforcing rules you protect yourself from bad habits. I think a separate template system and keeping the view separate would help keep everyone honest.
Eventually I started to do my modifications as plugins, which is one area where Wordpress really shines. Other systems could definitely take note of the way WP handles plugins.
In contrary, I am in the pursuit for the one universal language to be used everyhere replacing, javascript, html, css, templating language, ruby/python/php, sql..
As an aside, though, part of the reason we have different languages for things like backend code, markup and styling is that they're commonly done by different people with different specialties. A general-purpose language will not offer much benefit to a designer, but it will trip them up more often. Having a language tailored to your specialist is a good thing. The only time you'd really want everything done in one language is when the same coders are doing everything. I admit I'm in that situation very often, but it's more maintainable if you just use CSS or similar so that normal front-end guys can work with it.
The bigger the project is the more you have to favor readability and maintainability first, and using multiple specialized languages to accomplish different specific tasks is an effective way to keep the codebase readable and maintainable.
The syntax is very Django/Jinja alike. They took good inspiration.
Meanwhile, why the Wordpress team didn't switch to a template engine and orm after all those years is a true mystery to me.
As long as you use the MVC paradigm or at-least sperate views from business and data store logic it seems like PHP works fine to do the templating its self.
Yes I can see the argument that non coders have to learn PHP, but is PHP really much harder to learn then the template language?
Also templating add's performance overhead.
What you essentially end up with is a "hypertext preprocessor preprocessor"
http://codex.wordpress.org/Version_3.5
The biggest thing I wish WordPress would add is a better built in system for real templates, using a something along the lines of Twig (http://twig.sensiolabs.org/).
That mixed PHP code and HTML in your standard WordPress template disgusts me every time I see it. I know there are some custom solutions for creating real templates in Twig, but this should be part of the mainstream WordPress branch.