

Why WordPress theming sucks - CyrilMazur
http://yop.la/4b4

======
calvinf
#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.

~~~
CyrilMazur
For my defence, I also lead you to the get_search_form() function that does
NOT return the search form as a variable, but that really writes it as HTML

[http://codex.wordpress.org/Function_Reference/get_search_for...](http://codex.wordpress.org/Function_Reference/get_search_form)

So what, don't have I the right to bitch around WP naming for functions?

------
JoelSutherland
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:

    
    
      <ul>
        {% for post in hifi.get({'type':'post','orderBy':'-publishedAt'}) %}
        <li>{{ post.title }}</li>
        {% endfor %}
      </ul>
    

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.

------
josefresco
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.

~~~
CyrilMazur
And what are this so-called thousands of Google results from countless other
developers who have done the same and much more? Dirty workarounds that
shouldn't be necessary if WordPress had been made properly in the first place.
That's only what the author says: although WordPress rocks to propel blogs,
it's far from being made of good code.

~~~
slouch
you can rewrite a lot of the WP functionality by writing a plugin. if your
plugin is popular, it's modifications may be absorbed into the core software
that is distributed at wordpress.org. you're calling open source development
dirty workarounds.

~~~
CyrilMazur
If it worked like that, WordPress would already be OOPed and MVCed isn't it?

~~~
CyrilMazur
Nope, I don't follow up the WordPress development at all so I can't judge

However, I can't believe none of the WordPress developers has never suggested
to rewrite it using nowadays technologies?

------
byoung2
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!

~~~
calvinf
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.

~~~
rickmb
Oh, come on. WordPress could have started providing a decent API eons ago.
They don't care. Or they fundamentally don't see there's anything wrong with
spaghetti code and inconsistent API's.

The only reason they are abandoning PHP4 because it has become so rare they
can't test against it anymore, not because they want to improve anything.
Remember this crap: <http://ma.tt/2007/07/on-php/> ?

Which is typical for WordPress: one of the most successful companies to be
built on PHP, and all they do is bitch about it and use their influence on a
part of the community to hold it back instead of contributing, like Facebook,
Digg and such.

~~~
calvinf
As of writing this post, in WordPress's directory there are 11,351 plugins and
1,239 themes.

Source: <http://wordpress.org/extend/>

I'd call the API a success: it has thousands of authors releasing thousands of
plugins and themes and this is only the code that's been released open-source.

------
Xurinos
I don't want to hijack the intent of this submission too much, but I am really
curious about a question burning on my mind. I can't help but notice the sheer
number of WordPress mentions on HN and other sites lately, and while a
paranoid part of me wonders if this is something of a marketing blitz, I want
to try to get an unbiased opinion:

Is WordPress the way to go these days for blogging?

How does it compare to Blogger? What other reasonable options are there, and
how do they compare?

Edit: And how does it compare to posterous?

~~~
CyrilMazur
I don't know much about Blogger, but as it's a SAAS, how customisable is it?
Can you host your own PHP pages, can you do really what you want with the
theme?

I think there are differences to consider between hosted blogs and blog
scripts you can actually install on your own server and customise the way you
want.

Am I right?

~~~
tariq
you're correct. the differences between wordpress and blogger are vast. you've
mentioned the big ones already.

blogger is...

\- easy to setup

\- hard to customize

\- limited in terms of features / plugins (if any)

\- hosted as a service

~~~
Xurinos
How about vs posterous? (Sorry, I should have included it in my first post,
but I forgot the name.)

~~~
tariq
never used posterous, but it looks more similar to blogger than wordpress.
well suited for churning out a simple blog.

