Great Artists Still Steal

Young great artists still steal.
Old great artists litigate?

I missed the news about the Apple-HTC Patent Lawsuit (Google Android) until tonight when I found out about it on Mark Jaquith’s blog.

I’m happy that these cards of Apple are finally on the table. I think Apple’s Multi-touch related patents have been hanging over the heads of other hardware and software developers.

I don’t think I’ve ever found myself agreeing with John Gruber more:

“No doubt some of you are nodding your heads and see this as justification for Apple’s suit. But life isn’t fair. Great ideas make the world better. Apple can rightly expect to benefit greatly from the ideas embodied by the iPhone, but they can’t expect to reap all of the benefits from those ideas.

That’s the nature of implementing insanely great ideas. The bar has been raised, and, yes, Apple did most of the lifting. That’s how it goes.”

John Gruber, “Daring Fireball: This Apple-HTC Patent Thing“, Wednesday, March 3rd, 2010

Right now people are in their venting phase. What comes next?

Is there an effective protest against the Apple-HTC patent lawsuit? Particularly something that Apple customers should do?

I can’t see enough people caring, particularly on the eve of the iPad.

May 5th quotes from the comments:

Ian wrote “I think Apple customers should use one finger at a time in protest.”

Mark wrote “Apple has to operate in the system as it exists.”

Terry — how can I just choose one of his tasty insights — wrote “I do think that holders of software patents should be forced to do some sort of licensing because of the chilling effect they’re having on innovation.”

wp-content in Code is a Tell for Common WordPress Coding Mistakes

Regularly while reviewing themes and plugins, I’ll see URLs or paths that include ‘wp-content’. This is a often a hint of a WordPress coding mistake.

Consider this simple example:
<link rel="stylesheet" href="http://example.com/wp-content/themes/default/style-ie.css" type="text/css" media="screen" />

If as part of a migration or server change, WordPress ends up in a sub-directory this will break.

For file system based access, if I see ABSPATH . '/wp-content/ … things are likely OK, though if WP_CONTENT_DIR or similar are changed, this will also break.

I’m tempted to use the constant STYLESHEETPATH or is it TEMPLATEPATH? But, those are static variables initialized early in the WordPress run.

I’ve been meaning to write this article for a while. Serendipitously, when I went to write a first draft of it, Mark Jaquith‘s had just published “Force CSS changes to “go live” immediately“.

In the comments, demetris suggests using STYLESHEETPATH, but Will Norris quickly points out “sure, but you still have the same problem of bypassing any plugins that may be using the ’stylesheet_directory’ hook to pull the stylesheet from some place else entirely.”

Mark’s solution beautiful illustrates how to get the the URL location of the theme’s files and also directly the URL for the main stylesheet style.css:

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />

What Will describes is exactly what WordPress.com depends on. We have a similar, but much more complex solution to deal with the CSS in the content delivery network (CDN) going stale on updates, and also some web browser’s with their funky caches not keeping up. Our solution is both for WordPress’s front end and dashboard (also dealing with the various ways CSS can be called or @imported).

I do have one niggle about Mark’s solution, and it’s the same with most WordPress code out there, the use of bloginfo(). Strings within strings within strings within strings give me headache, so to ease readability and make it more verbose replace:

bloginfo('stylesheet_url'); with
echo get_stylesheet_uri();

bloginfo('stylesheet_directory'); with
echo get_stylesheet_directory_uri();

If you look up in the codex get_stylesheet_directory() you’ll see that would be the file system path, which is confusing given the behavior of bloginfo('stylesheet_directory'); returning the URL. This presents another reason why I favor the consistency of always using the specific getter function calls. Also, when I’m using bloginfo() calls, I have a tendency to get in a mind set where I think I’m directly retrieving the option in the database (accessing directly the info shown in wp-admin/options.php). By using the specific getter function, I remember that there are hooks (actions, filters) that might be triggered.

Some of the other areas, I see wp-content is in CSS style sheets themselves. Relative paths are almost always the correct solution.

Far more painful for me are the plugins that assume where plugins are, because this can take quite a bit of debugging to unwind the assumptions.

That is a topic for me to postulate on another day. Will has written the very relevant “WordPress Plugin Pet Peeve #2: Direct Calls to Plugin Files“. Duane Storey has taken a crack at a “WordPress Plugin Checker“  for these and other common problems (which I’m certain he would enjoy feedback on).

Movable Type 200% Open Source!

Where 100% and fully are not quite the definitions I’m used to.

Yes, Movable Type Open Source should be celebrated! It is awesome that it already includes everything that was released as Movable Type 4.0 and more. As I understand it there should soon be a stable release. But I am confused by the conversations I read and concerned by the phrases used to describe this “version”.

Continue reading