[wp-hackers] Help with the API on WordPress.org?

Mike Schinkel mikeschinkel at newclarity.net
Sat Jan 17 23:57:04 GMT 2009


"Otto" <otto at ottodestruct.com> wrote:
Mike Schinkel <mikeschinkel at gmail.com> wrote:
> > P.S. Also, if this is the "preferred" MIME type for serialized PHP 
> > would you agree that web services returning it such as at
> > http://api.wordpress.com should be using it?
>
> I'm of the general opinion that it doesn't make any sort of 
> difference either way. I mean, yes, you can be pedantic about 
> it and add special code to the thing to make it output a different 
> mime type in the header, but does it have any real-world impact? 
> No, not at all.

Sadly too many people have that view because they don't see the problems when they are coding and testing so they think they don't exist. Mime types matter for security, for maximum interoperability and for enabling serendipitously-discovered use-cases.

> MIME Types are fine and I like the idealized world that sits 
> behind them, where bits of data are typed and applications use 
> those types and everything sits happily in it's own little fairy 
> village where things are what they are and other things can then 
> handle them correctly. And we'll all have lollipops and candy 
> for breakfast, and pancakes will be free on Tuesdays.
> But I think that on the whole, strict type rigidness causes more
> problems than it solves. It makes absolutely no difference what 
> the mime type returned is unless the client looks at it and acts
> differently based on it.

Sadly the approach you take on this has the opposite effect to what you aspire to. Yes, rigidness causes too many problems, but no one is saying to be rigid on the client end. If you were to instead consider The Robustness Principle[1] a.k.a. Postel's law "Be conservative in what you do; be liberal in what you accept from others" then you'd see that it is better for the server to be strict which then allows the client to be strict or not-strict, whatever it likes. Rigidity only causes problems with the client is rigid too.

I do understand the instinct to rebel from authority, I have it myself, but I hope you can see how arguing for chaos on the response end of the HTTP standards is counter-productive. 

-Mike Schinkel
http://mikeschinkel.com/custom-wordpress-plugins/

[1] http://en.wikipedia.org/wiki/Postel's_law




More information about the wp-hackers mailing list