Celebrate by Writing

My birthday is coming up soon so it’s that time of the year when friends start reaching out and asking where they should fly to and how we’re going to celebrate.

After a good run in the post-vaccinated-and-boosted part of 2020 that felt relatively “normal”, including traveling almost 200k miles, I’m going back into a pretty locked-down state of things. Omicron has just been catching too many friends and loved ones, even with fairly careful measures and testing. So what’s happening on January 11th?

What I’m asking for my birthday is for people to blog!

Whether professionally on WP.com, socially on Tumblr, or privately journaling with Day One, there’s never been a better time to stop being a passive consumer of the internet and join the class of creators.

Write for a single person. Share something cool you found. Summarize your year. Set a blogging goal with reminders. Get a Gutenberg-native theme and play around with building richer posts. Start a nom de plume. Answer daily prompts on Day One. Forget the metaverse, let’s hang out in the blogosphere. Get your own domain!

If you’re a close friend that feels intimidated by the software at all or that you don’t know where to start, I’m happy to hop on a Zoom to go through everything on a screen share. That will also be a great learning for me for places we can improve things, which is also a fantastic gift!

Should We Have Hidden Options?

Alex King has recently suggested that we have an about:config for WordPress. When I first thought this I thought “great!” because we’ve had this for several versions now: if you browse to options.php directly you can edit any option in the database, even those that have no UI because they’re from plugins or just something we don’t expose.

However after several comments pointed this out Alex began clarifying his request, some of it isn’t entirely clear to me (I would never want to go back to storing configuration in files, that was a nightmare we eliminated in 1.0), but the main gist is not merely exposing an interface to the options we have, but rather adding many more options to the code to allow for more than one way for some core parts of WordPress to work.

With that clarification, I think it’s pretty safe to say that something like that will probably never be incorporated.
Options have several costs, which is why we avoid them fairly religiously in WordPress. The most obvious cost is UI clutter — everyone wants their 15 pixels of fame and configuration screens quickly devolve into pages of utterly confusing junk no one understands or cares about.

A very closely related problem is user frustration. With WordPress we’re trying to make publishing to the web as effortless as humanly possible, and one part of this is taking care of a thousand little details that really shouldn’t ever cross your mind — if we’re doing our job right. One common reason for the proliferation of options in open source software is that (news flash) people often disagree about how things should be done, often violently and vocally in threads that can drag on for weeks on development mailing lists. (It is frustrating for many people that these option flame wars draw more discussion than useful topics or questions.) Few like fighting about things, and project leaders pull the proverbial car to the side of the road and declare “Screw it! We’ll do both!” To satisfy a handful of developers a burden is put on countless users.

I try to build everything imagining I have a million users. (Someday!) Small things add up — if there is an option in the interface that people have to think about for only 2 seconds (which is probably low) across a million users that’s 23 days (555 hours) of time lost to the world! (Call centers track efficiency per second because of similar constraints. Small things add up.)

Alex’s hidden options don’t trigger either of these by definition. However there is a third hidden cost: as the number of options increases it becomes difficult (or even impossible) to test for all possible combinations of how the options may interact in different enviroments. This also makes support a real bear. Costs go up, bugs increase.

This is why we say no by default to pretty much every suggested option, and we do our best to remove the ones that have built up over the years. (I just axed a whole panel earlier tonight.)

All that said, hard-core developers often need flexibility in the system to expand WordPress to things we’ve never even imagined, and that’s where our plugin system comes in. While we often say no to new options, we rarely ever shoot down a suggested extension to our plugin API. The beauty of this is it allows for near-infinite flexibility in how you interact with the program (there are some amazing plugins out there) while still keeping the core light, clean, stable, and fast. It also makes support relatively painless: “Does it work when you deactivate the plugin?” When someone says they want to do X and it should be core because it can’t be a plugin, 9 times out of 10 I see that as a plugin API bug, not a core bug.

In summation: Don’t waste your users’ time like I just wasted yours with this essay and be mindful of hidden costs. If I had a few extra hours I would edit and cut most of it out. (Good thing I don’t have a million readers.)

A Better Image Rotator

The Hiveware Image Rotator, shared by Mr Zeldman, does one thing and does it fairly well: it shows a random image on each reload. However, the approach the script takes is slightly flawed, and could be improved as detailed below.

My first issue with the script is that it is really only set up to handle two types of files, GIF and JPEG, and then only with the file extensions of .gif or .jpg, so something like .jpeg (fairly common) would not be included. Not to mention the noble PNG is left out entirely. Fixing this, however, leads us to a more fundamental problem: the images are served through the script. This means that the script has to handle the content-type header, something that is messy to do. A better method, I propose, is for the script to merely serve a temporary redirect header, which sends the browser with a minimum of overhead to the actual location of the file, which has a number of tangential benefits including that it allows the image itself to be cached properly, either by a caching server or the browser itself, and it delegates content negotiation and such to the web server, which is most likely infinitely better at it.

So now what we have a script which reads files in a directory, grabs the ones with a user defined set of file extensions, and sends a simple Location header to whichever file is randomly chosen. The complication now that the location of the image is now important in terms of the web server document root. One bonus of Dan Benjamin’s method is you can use images outside of the web root, though I don’t know why anyone would want to do this. The script could ask for two variables to be defined, the absolute path to the images and the path to the images through the web server, but I would like for this to be as ridiculously easy to setup as possible. Another option would be to subtract the $DOCUMENT_ROOT variable from the absolute path given and use that, but that would require people to know the absolute path of the directory they’re using, and like I said I’d like this to be easy as humanly possible. The best solution is to use a relative path; if the users enters nothing it’s assumed that the images are in the same directory as the script but if they aren’t the path can be entered in a relative manner, like “images/random” or “../rand-img”. Easy peasy.

Finally, instead of the plain rand() we’ll use mt_rand, which is about four times faster and slightly more random. What do you get? The Photo Matt Random Image Script. I’ve tested it thoroughly, but if you have any problems don’t hesitate to let me know. It’s just standard HTTP though so I don’t foresee any trouble. Something neat about this is that with the code we just wrote, you can also serve random anything—from zip files to MP3s—just by changing the extension line. Enjoy! Here’s an example of it in action, you should recognize some of the images as the delightful graphics Jeffrey has been putting up, the rest are snips of photographs I haven’t uploaded yet.

A Random Image

Berlin WordPress / Web 2.0 Expo Drinkup

I’m in Germany for the first time and I’d love to meet some of the WordPress community here. With the help of Yamile Yemoonyah we have a venue and such for a get-together this Thursday. Since there’s an upcoming Web 2.0 Expo right here in Berlin we’re co-hosting with those folks to make the event extra-fun. Here are the deets:

Thursday, Oct 9th at 7 p.m.
“Dachkammer”
Simon-Dach-Str. 39
10245 Berlin
030 2961673

If you have a German blog or Twitter please help spread the word! Hope to see you there.

Update: Got a discount code from the conference, if you register here and enter the code webeu08gr99 you’ll get a 35% discount.

I loved this comment on Hacker News, especially the last paragraph which I’ll quote here:

The question implicit in your comment is: Could we design a system that offers the ease of accessibility of the first few steps of a PHP programmer’s career but, as one climbs the learning curve, eventually blossoms into Python or Ruby or even Lisp? I wish I knew. My best guess as of this morning is that a demigod could design such a system, but it’s very difficult for mortal humans to do so, because once you know how to program it’s hard to avoid overdesigning, putting in things that will eventually be useful in year two but are discouraging in year zero. We make terrible pedagogical mistakes, like turning everything into an object. (Does your ORM seem intuitive to you? That is why PHP is beating your system in the marketplace.)

Rails Bashing

Since 7 reasons I switched back to PHP there seems to be a trend of Rails-bashing articles, epitomized by this one which is a fine example of the form until it advocates ASP.NET. Through it all, I still haven’t heard of a startup or web service that failed or succeeded due solely to its web framework or language. These articles are like the celebrity gossip stories of Web 2.0, complete with ad hominem attacks, and just as useless. Hacker News tends to be a fairly high signal source of discussions actually relevant to startups.

Multiple Google Accounts

The ability to access two Gmail accounts at once in the same browser is my favorite feature that Google has added in a long time, even though I don’t use Gmail. I have some accounts I basically use for archival and search that I always end up having to open a different browser to access. Unfortunately, this feature breaks the already-fragile GV Mobile on my jailbroken iPhone 4. The two things I miss from Android are Google Voice integration, and the Navigation feature.

Only in New York

Last night around 10:15 decided to head out for dinner, and somewhat randomly picked the Cuban restaurant Guantanamera because it was nearby. Sat down in a booth near the bar, facing the band, and ordered some mojitos. Over the din of the other diners I thought “hey this house band isn’t half bad.”

Within a few minutes of listening it became very apparent that beyond “not half bad” they were actually really remarkable. What a treat! Ordered a steak and sank in, letting the music (and mojito) flow over me. A half hour later a lady from one of the front tables got up to sing with the band — which isn’t always a good thing. They started on The Man I Love and it was sublime. The song started out as a ballad but then they kicked it up to a fast afro-Cuban beat, and the singer scatted over the beats for a good 4-5 minutes. It turns out it was Janis Siegel of the Manhattan Transfer! I felt particularly fortunate as I had been bummed to miss the Manhattan Transfer show at the MontrĂ©al Jazz Festival in June, but here, of all the most random places, was one of my favorite members performing at a small family joint in Midtown West.

Janis sat down after one song but a string of similarly talented musicians came in and out of the band until the restaurant started to close down. I didn’t recognize any of them but the music was so good. 🙂

There was a recording device above the band that was collected by a fellow who I caught up with outside the restaurant as he was hailing a taxi. His name was Paul Siegel and he’s the co-president of Hudson Music which is a music education group (with a website powered by WordPress). I learned the percussionist leader of the house band was Pedro MartĂ­nez and Paul follows and records him several times a week at different venues. Apparently Guantanamera is a long-time musician hang-out where even folks like Eric Clapton sat in with the band.

Only in New York.

Have We Met?

Having a blast here at SxSW. I’m trying to keep a SxSW blogroll of people I’m meeting but after just a day I’m far, far behind. If we’ve run into each other use this entry to leave a comment with your name, URI, and where we met, if I haven’t already listed you.

The panels today were pretty decent, though I’m sorry I missed Jeff Veen’s panel, which I heard was excellent. Monday is going to have some great presentations. So far there have been many memorable moments, some of which I’m sure I’ll be hearing about from others for a while. I’m going to do a few more pictures and then it’s to bed for me. They put some really good panels early in the morning and I still have to grab some sleep.

Episode III

I just got home from seeing Star Wars Episode III, and it was a fantastic movie. Totally worth staying up to 4 AM for. Not just a great Star Wars movie, but a Good Movie independent of anything else out there. Then again I’m a total sucker for epic space sci-fi and cheeseball storylines, but go see it and decide for yourself. I’ll probably catch it once or twice more this weekend.

Baggage Handlers

Still at the airport waiting. A plane just arrived and tehy’re loading and unloading the luggageand it’s really shocking — they’re really chunking it. They pick it up and literally throw it so it hits the back of the luggage card. I’ll have to remember that next time I pack.