Redundant validation is evil

Don’t you hate it when something you think of as a good habit turns out to be a bad habit? I have long been a big proponent of defensive programming. Never assume the arguments being passed to a method are good, always validate everything, and generally protect yourself from other people’s bad code or even your own bad code elsewhere in the system. I’m here to tell you that you can go too far with this philosophy. ...

June 23, 2006

The bottom line on Net Neutrality

Larry Lessig pretty much gets to the bottom of the Net Neutrality debate: One clue to this Net Neutrality debate is to watch what kind of souls are on each side of the debate. The pro-NN contingent is filled with the people who actually built the Net – from Vint Cerf to Google to eBay – and those who profit from the competition enabled by the Net – e.g., Microsoft. The anti-NN contingent is filled with the entities that either never got the Net, or fought like hell to control it – telecom, and cable companies. ...

June 22, 2006

Making computer books more usable

The book Programming Ruby, also commonly referred to as “the pickaxe book,” is widely regarded in the Ruby community as a must-have. Unfortunately, it doesn’t really meet my expectations. You can find parts of the book online, so you can see for yourself what I’m talking about. Take a look at the chapter on Basic Input and Output. Let’s say you want to open a new text file and direct your output to that file. This seems pretty basic, and you’d expect to see it explained in a chapter that purports to cover input and output. On this seemingly important topic, readers are given one sentence and no examples: ...

June 19, 2006

Ceca in Wikipedia

Looks like the article on Ceca, a Serbian pop-star/ultranationalist figurehead, is missing a bit of information. The article on her husband, Serbian war criminal Arkan, needs some work as well. To me these sorts of articles are some of the most interesting cases for how well Wikipedia works. They are obscure to most Americans, so partisans can easily skew what is becoming the historical record for people like Ceca. The concert review describes her as an unrepentant supporter of her husband’s program of ethnic cleansing. The Wikipedia article treats her as a generic pop star, despite some discussion of incorporating her baggage in the article. ...

June 19, 2006

Establishing facts on the ground

Even though I never actually read the book, Lawrence Lessig’s book Code and Other Laws of Cyberspace is often on my mind. The book’s argument that code and algorithms are rules as much as anything else should be always be in the back of the mind of every programmer. Just look at the different kinds of content management systems out there. The rules for editing content in a wiki are very different than those for editing content in a weblog application, and those rules are the essence of those applications. It’s illegal to share copyright-protected digital media, but there’s lots of code out there that makes it easy to do so. It’s not illegal to watch DVDs from Europe in the United States and vice versa, but DVD players come with code preventing you from doing so. ...

June 16, 2006

How many controllers do you need in a Rails application?

When it comes to Ruby on Rails style, one of the toughest decisions to make is how many controllers you need. The default custom for Rails seems to center around having one controller per model, but that doesn’t always make the most sense. To discuss this at a high level for a moment, models generally mirror the structure of the database, so there’s one model per table. Controllers are arbitrary collections of actions, but are usually associated with a particular model, so if you have a model called “posts” in a weblog application, you might have a controller called “posts” as well, with actions like list posts, new post, edit post, and so forth. This was generally the pattern I followed when I started creating Rails applications, but increasingly I’m finding there are other ways to group functionality in controllers that make more sense. ...

June 15, 2006

Flickr Suppresses Screen Shots

If more than half of the pictures on your Flickr account are screen shots, Flickr will suppress your images in global search results. The theory is that people come to Flickr to see photos, not group shots of your World of Warcraft guild or the sculpture you just created in Second Life. This is strictly a business decision. Either Flickr knows their users as well as they think they do, and this is the right call, or they’re cutting off a potential market for no good reason. Which is it? Beats me. The one thing that’s certain is that Flickr is a much better application for sharing screen shots than anything else I’ve seen, for the same reason it’s great for sharing photos. ...

June 14, 2006

Yahoo, get a clue

The other day I wrote about how YouTube has revolutionized video on the Web by making it accessible to just about anybody, regardless of which platform and browser they use. That’s still not the case for many other Web sites, even sites that launched recently. I have been trying to watch the video clips from fifaworldcup.com (created by Yahoo), and I cannot get them to play on my Mac under Firefox or Safari. That’s broken. ...

June 12, 2006

How Vox is different

Ever since the initial release of Movable Type, Six Apart has been invested in the idea of writing content management systems that consist of an authoring tool that publishes static files. In the more recent Movable Type releases, support for dynamic publishing templates has been added, but Six Apart has still been wed to the author and publish model rather than a model that merges authoring and publishing into one big piece of software. That is, until Vox. (I’m assuming TypePad works like a Movable Type installation internally. It seems that way from the user’s perspective.) ...

June 12, 2006

Feed authentication

One question I’m wrangling with right now is how to add authenticated feeds to an application. I have an application that you have to log into in order to use. The application will publish some feeds. I have to decide whether or not to require authentication to view the feeds, and if so, how that authentication will work. There are a number of problems associated with feed authentication. The first is that I have no idea what sorts of authentication are widely supported by feed readers. The second is that most people subscribe to many, many feeds, and I wouldn’t want them to have to enter their username and password every time they attempt to refresh the feed. The third is that if you create an authentication system that doesn’t require the user to enter their password, the link to that feed is almost certainly not secure. The user will be able to copy the feed URL and email it to anyone they like. This is especially problematic if the user’s username and password are included in the URL. And the fourth is that regardless which system I use, it needs to be understandable by users who don’t know what RSS, Atom, SSL, and Basic Authentication are. ...

June 12, 2006