[wp-hackers] Re: 1.5.2 or on to 1.6?
m at mullenweg.com
Mon May 23 08:49:08 GMT 2005
Martin Geisler wrote:
> I've only been using WordPress since February, but what has struck me
> as the biggest problem is the coding standard used. I've written a
> longer piece about it on my blog, but to summerize:
I'm not sure how best to address your concerns, except to say that the
codebase of WordPress is very mature (from b2 goes back almost 4 years?)
and such over time it has development a number of idiosyncratic quirks
that may seem strange to a newcomer.
I'm as aware as inconsistencies as anyone, like post.php not using the
wp_insert_post function, but the highest priorities in development are
focused at our two primary audiences, end-users (who never look at core
code) and plugin authors (who use the documented APIs). If you want to
be a core hacker, then you'll have to get used to some different
stylistic tendencies. However entries such as yours (which I've seen
dozens of) are akin to someone coming into your house and criticizing
where you put all your furniture and organize your books.
If you look at code from much older releases, like .71, you'll see that
it gets cleaner and more streamlined with every release (less global
usage, etc), but things usually get cleaned up when another improvement
is happening to that part of the code. Rewriting things for no good
reason other than rewriting them tends to introduce bugs. Bugs hurt both
of our core audiences.
Commenting is tricky. Some "well-commented" code I've seen had a bunch
of lines of repetitive filler that "documented" what you could easily
see by just looking at the code itself and doubled the size of the
program. APIs should be documented religiously, but I think spending a
ton of time on redundant comments for code only a few core hackers will
ever look at will bloat the codebase and waste everyone's time. I also
believe that well-written code usually doesn't need comments unless it's
doing some sort of voodoo or workaround. (See gettext.php.) If you're
doing something that is so long and complicated that it needs a lengthy
explanation, it probably is worth breaking it into several simpler pieces.
I think if we surveyed our users, very few (if any) would bring up the
"coding standard" as an issue they care about. We need to focus more on
things like the excellent issues Mark J. raised in his response.
http://photomatt.net | http://wordpress.org
http://pingomatic.com | http://cnet.com
More information about the wp-hackers