Live data from Hacker News

Why WordPress theming sucks

yop.la

1–10 of 28 posts

Re: Why WordPress theming sucks

#2
I bet the developers have thought of rewriting it using OOP and an MVC pattern, but all current plugins and themes would have to be rewritten as well. It's not so bad, since you'd only need the top few dozen plugins and themes rewritten to get traction.

I'd be willing to help out if anyone here is brave enough to try a rewrite!

Re: Why WordPress theming sucks

#3
post #2

I bet the developers have thought of rewriting it using OOP and an MVC pattern, but all current plugins and themes would have to be rewritten as well. It's not so bad, since you'd only need the top few dozen plugins and themes rewritten to get traction. I'd be willing to help out if anyone here is brave enough to try a rewrite!

Why bother? You could go a long way and make things clearer by giving the functions better, new names and deprecating the old ones. "Rewrite with OOP and MVC" is an easy, whiny, pointless suggestion. Wordpress is warty, but it doesn't need a rewrite.

Re: Why WordPress theming sucks

#4
post #2

I bet the developers have thought of rewriting it using OOP and an MVC pattern, but all current plugins and themes would have to be rewritten as well. It's not so bad, since you'd only need the top few dozen plugins and themes rewritten to get traction. I'd be willing to help out if anyone here is brave enough to try a rewrite!

WordPress is abandoning support for PHP4 and MySQL 4 in version 3.1. This will allow them to incorporate many of the features in PHP5 they haven't been able to do yet such as stronger OOP.

http://wordpress.org/news/2010/07/eol-for-php4-and-mysql4/

It doesn't need a rewrite. Instead, work with the many brilliant devs who have been improving it for years and know it inside-and-out -- including its flaws and areas for improvement.

Re: Why WordPress theming sucks

#5
#1) True. It does not use an MVC paradigm. That's not the way it was designed, and they're not able to make it MVC w/o breaking backward compatibility with the huge ecosystem of plugins and themes that currently exist.

#2) True, and I agree. The function naming could be improved. If you don't know what the function does, look it up in the codex or the source code. The documentation could improve, too, but one of the stated goals for their next development period is improved docs.

#3) Look at the docs. Yes, the_title() writes to the page. If you want to use the title in a variable, there is get_the_title(). There are generally other functions or parameters you can do if you want it to return the value rather than writing it.

#4) False. The comments template file is comments.php.

#5) True.

Re: Why WordPress theming sucks

#6
My company hates WordPress style theming. In fact, many of the design decisions we made on our product were to address this pain point. There are so many details to remember that the process of creating a theme becomes about Wordpress rather than about front-end web code.

We use Twig as a templating language and expose our entire data API so there isn't a massive set of functions to learn. Here is an example of how to list the latest posts:

  
    {% for post in hifi.get({'type':'post','orderBy':'-publishedAt'}) %}
    {{ post.title }}
    {% endfor %}
  
This keeps the process of creating a theme mostly about HTML/CSS because it dramatically reduces the specific information that you need to know about the platform itself.

Re: Why WordPress theming sucks

#7
post #5

#1) True. It does not use an MVC paradigm. That's not the way it was designed, and they're not able to make it MVC w/o breaking backward compatibility with the huge ecosystem of plugins and themes that currently exist. #2) True, and I agree. The function naming could be improved. If you don't know what the function does, look it up in the codex or the source code. The documentation could improve, too, but one of the…

so 3 of his rants could have been resolved by simply reading the docs. brilliant.

Re: Why WordPress theming sucks

#8
post #2

I bet the developers have thought of rewriting it using OOP and an MVC pattern, but all current plugins and themes would have to be rewritten as well. It's not so bad, since you'd only need the top few dozen plugins and themes rewritten to get traction. I'd be willing to help out if anyone here is brave enough to try a rewrite!

Why bother? You could go a long way and make things clearer by giving the functions better, new names and deprecating the old ones. "Rewrite with OOP and MVC" is an easy, whiny, pointless suggestion. Wordpress is warty, but it doesn't need a rewrite.

Rewrite with OOP and MVC" is an easy, whiny, pointless suggestion

Separating the design from the code would make it a lot easier for designers to create themes without having to worry about PHP. A proper templating system like Smarty would make a huge improvement with its built-in modifiers. For example:

  ", "", true ); 
    if(strlen($title > 80) {
      echo(substr($title, 0,80)."..."); 
    }
  ?> 
Would be this if Wordpress used Smarty:

  {{$TITLE|truncate}}
This makes any display logic in the templates more portable when switching themes as well, because designers will be less prone to putting that code in header.php or single.php.

Re: Why WordPress theming sucks

#9
post #5

#1) True. It does not use an MVC paradigm. That's not the way it was designed, and they're not able to make it MVC w/o breaking backward compatibility with the huge ecosystem of plugins and themes that currently exist. #2) True, and I agree. The function naming could be improved. If you don't know what the function does, look it up in the codex or the source code. The documentation could improve, too, but one of the…

the_title() writes to the page. If you want to use the title in a variable, there is get_the_title()

Actually, within The Loop, you would us the_title('','',false)

Re: Why WordPress theming sucks

#10
So let me get this straight. Some developer/guy spends 5 minutes trying to theme a WordPress website for himself and decides to write an article bitching about it instead of actually reading some documentation or the thousands of Google results from countless other developers who have done the same and much more? The first commenter pretty much sums up how much this guy knows about WP themeing (hint: nothing).

This almost happens to me all the time but I know better. I spend 10 minutes with a new program, decide it's batshit crazy but instead of posting a lame article I have the wisdom and experience to stop and tell myself "I'm just a noob" and will probably embarrass myself.

Post reply on HN