Beautiful software

February 23rd, 2008

Two recent articles touch the problem of Beautiful Code - Steve Yegge’s Portrait of a N00b and Jeff Atwood’s Code Isn’t Beautiful. I would take this discussion a little further from the talk about coding and architecture and go to software in general.
What is beautiful software? Perhaps most junior programmers believe that the software is beautiful when the code at a micro-level is beautiful. They focus on little details that they believe are important and try to write code that looks perfect according to these standards. Detailed comments, short functions, functions with a single return point - all these little things that we learn in school and don’t even dare to question them.
From here people can evolve in two directions. They either get into the hell of premature optimization and think software is perfect when every line of code is written in the absolutely most efficient way possible or become architecture astronauts and start dreaming about utopic designs that can solve any existent or inexistent problem. Ironically enough, architecture astronauts actually produce designs that are hard to extend and sometimes even hard to use in the intended way.
To me beautiful software is software that does only what it needs to do and nothing more. The code doesn’t need to follow dozens of written and unwritten “coding standards”, doesn’t need to be optimized more than by using common sense and doesn’t need to be an architectural masterpiece. The interface doesn’t need to expose every obscure functionality just to claim it has more features and it should focus on solving specific tasks in well defined steps. Beauty lies in simplicity.
In general software doesn’t need to be regarded as a piece of art. Software is not art, no matter how much we would like to call ourselves artists. Software is just a tool that helps people solve their problems. It’s not an exhibition of design patterns or clever optimizations.
Software will never be beautiful if that is your goal. Its beauty will come from the fact that it solves a real problem in a simple way. It’s just that easy.


Tags are everywhere

February 8th, 2008

Tags are cool. Having the ability to tag anything is one of the ingredients of making your site “web 2.0″. But I’d argue that most of the uses of tags are actually somewhere between confusing, useless and annoying. Just ask yourself when was the last (or first) time you actually used a “tag cloud” - or how many times you see people that use tags with spaces and don’t even notice that they have been split into multiple tags.
I was really excited when GMail introduced labels. Finally somebody realized that emails don’t always easily fit into one folder or another. This is a simple extension of the folder concept which doesn’t stay in your way and sometimes proves itself very useful.
But there is another very cited example when it comes to tags: delicious. Its promise is that you’ll be able to easier find an old bookmark if you tag it with some relevant keywords. This sounds good but doesn’t really work in practice. As time passes, your view about a specific subject changes and you would use other tags than you used initially; searching by tag proves itself inefficient and you usually end up finding that link using Google. My guess is that a much better way of dealing with bookmarks would be a solution that combines chronology and search by content. When the bookmark is pretty recent you usually remember when you saved it (yesterday, last week, last month) but as time passes you will only remember specific keywords from the actual document pointed by the link.
Blogs are perhaps the best place to see misuse of tags. Some people seem to believe that tagging each post with as many words as possible would help them get more readers. It’s literally like the long forgotten meta-tag mania. My guess is that search engines pretty much ignore these tags and browsing for them on Technorati is not too practical either.
Tagging is just a trend as many others, but I think its time has already passed. Let’s move on!


Blogs as social networks

December 27th, 2007

Social networks in their current state have a problem: they are centralized and isolated from each other. Our identity is split all around the net.
From all these “profiles” that we have, blogs are the most open ones. No matter where we host our blogs, we can still build blogrolls and “follow” other people using feeds. But blogs are still in their infancy - we don’t even have a uniform way of tracking comments!
I predict that blogging will evolve in a way that will make it a good alternative distributed social network. We already have most of the ingredients - open standards such as HTTP, OpenID, Atom and OpenSocial - but we need to glue them together and build something consistent that has the chances to become a de facto standard. DiSo seems to go in that direction.
I’m waiting for the day where I can have all the Facebook’s features (and can install OpenSocial apps) inside Wordpress.


Facebook and privacy awareness

December 13th, 2007

One of the biggest flaws in Facebook is exactly one of its main strengths: the applications.
Everybody cares more or less about his online privacy. We register at tons of websites most of which we will forget the next day. But people don’t provide too much personal information for every website they sign up for. Many people even use a throw-away email address when they just want to test the latest world-changing web 2.0 application. There are countless discussions about how Google knows “too much” about us and even non-technical people are aware of the basic privacy issues.
What about Facebook? Nothing unusual. They encourage us to fill our profile - name, email, address, interests, relationship status… even political views and religious views… and of course friends. I don’t really mind giving these details to Facebook once I decide I will use it a lot. But here come the apps. Every time I add a new app to my profile it will have complete access to all these details. I wonder how many people are really aware of this. It’s true that when you add an app you need to check Allow this application to know who I am and access my information. But is this really enough? Are users really aware that this application has nothing to do with Facebook and it is developed and hosted by some random people out there? Please, next time you are invited to check how similar you are to your friends or you are bitten by a vampire and invited to bite somebody else - think twice! Do you really want to share your profile information with the people that developed that crazy application? Is the one minute fun worth it?


Django sprint is over

December 3rd, 2007

This weekend I joined the Django worldwide sprint. Here are some random thoughts:

  • Open source projects should do this more often. Having such a sprint makes people really contribute instead of just saying “maybe I’ll do it sometime”.
  • Work should start at the same time all over the world. This might be inconvenient but it has some advantages. It makes people feel like a team - they know they work together for the same goal. Being in Beijing, we started more than 12 hours before the core team. Actually by the time they started we were already leaving. This made us feel isolated and we also stayed a few hours without connection to the Django servers since they were in maintenance. I don’t think that working a night during a weekend is a show stopper for someone that is interested in contributing to open source.
  • People need to set goals. I am sure that the core team or the long time contributors had some goals in mind, but me and our colleagues came just from the desire to help, not really knowing what we will do. Actually I was one of the people that was encouraging others to come even if they don’t know what to do. The problem with this approach is that you start by spending time looking for a something to do. This is not a very pleasing nor easy thing and time passes very fast. Some planning should also go in how the work will be done. If you want to do pair programming, TDD, etc. - know that beforehand.

Bjørn also wrote about this.


Fixing blog comment tracking

November 25th, 2007

Tracking blog comments is still painful, even after all the years since blogging became mainstream. The most important concept behind blogging seems to be forgotten by the available platforms, which provide only comment RSS or at most email notifications.
There’s a recent wave of web sites trying to solve this problem using a very strange approach, while their whole business plan assumes that tracking blog comments will always be a pain. Yes, I’m talking about coComment.com and co.mments.com. They basically let you “bookmark” a post and monitor it for you. Of course this doesn’t always work, since there is no standard way to do it.
Yet another “player” here seems to be disqus.com, whose solution is not so technically questionable, but is still not very practical. You basically “outsource” comment management for your blog to a forum you create on their website. Your blog engine will use their API to post comments in that forum, which can be monitored by other disqus users. The first problem I see here is that you can not track comments made on blogs that don’t use their system. This is a chicken and egg problem. Why would I use them to track comments when there is nothing I can track? And why would I use them for my blog’s comments when nobody is using them for tracking?
Here is an easy to implement solution I have been thinking about. As in disqus’s approach let the blog engine “ping” somebody when a new comment is posted. The difference is that it should ping an URL provided by the commenter. The most obvious provider of such URLs would be online feed readers - since you use them to track new posts why not use them also for comments? Blogging platforms themselves could also implement the “receiver” part of this API, so you could track comments you make in your blog’s administration section.
Of course, nobody would gain from implementing this except the end user. Maybe that’s why people rush to create workarounds instead of solving the real problem.


I want smart bookmarks

November 12th, 2007

del.icio.us is dumb. Excepting the “social” part it only provides a plain CRUD interface for bookmark management.

What I want to have is a service that “knows” what I am bookmarking and treats it accordingly. When I post links to Flickr or Zooomr images, to artists or albums on last.fm, to products on Amazon - it should always use the appropriate API to get more information about the link.

Handwritten tags are simply not enough. Machinetags wants to make the tags themselves smarter (the project seems dead though), which is a big step forward when it comes to tagging content. But when it comes to URLs, we should exploit the original content instead of (only) tagging the URL yet again. The web is all about URLs - treating them as simple strings is just like going shopping in a Ferrari.


Architecture and usability case study

August 31st, 2007

Common sense tells us that poor architecture usually leads to maintainability or scalability issues having no direct impact on usability. Sometimes however, a bad design decision can hinder the development of a friendly UI.

A good example is Winamp’s plugin system. Have you ever noticed what happens when you want to view/edit a file’s metadata? The dialog that shows up is part of the plugin responsible to handle that specific file type and not part of Winamp itself. “That’s obvious - you might think at first - the only one that knows exactly what metadata can exist in a specific file is the plugin.” And this is definitely true, so the original developers choose to let plugin creators design their own dialogs.
It looks good to see that the player is “smart enough” to provide different dialogs for different files, but two (usability) problems arise from this approach:

  1. Consistency. Users are provided different dialogs with different capabilities and layouts. This can be confusing. How come that you can edit the artist for one file but for another file you just get a message box displaying the full path (yes, this happened to me)?
  2. Mass tagging. How can you implement mass tagging in such a case?

foobar2000 choose another way to do it - and it does a much better job. Plugins have no UI, at least not for tag editing; instead, the player provides a common dialog for this task. The usual fields like artist or title are always named the same (independent of the name of the actual tag that will get written to the file) and have the same position in the dialog. You can also enter additional key-value pairs which will be stored in the metadata since most tagging standards support arbitrary tags. What happens behind the scenes (or what I think it happens) is very simple: the player can ask the plugin to set either a “standard” tag (artist, etc.) or a “custom” tag to a specific value. The plugin has to figure out how to actually encode both the keys and the values. Looks like this approach solved the consistency issue and mass tagging is also obvious to implement. I can bet that foobar2000’s code is also much cleaner because of this, but that’s another story.


Forum usability

June 6th, 2007

I just joined a Romanian stock exchange investor forum. While reading the welcome message, I saw the following sentence written in bold: “Don’t use F5 or Refresh in the browser, because your last message will be reposted.” I simply couldn’t believe my eyes. Why on earth would someone even bother writing this when in about the same time he could have fixed the real issue? If you have to warn your users about some behavior of your application, it means you have a usability issue! Not to mention the fact that users don’t read the manual unless they really have to. I was reading that message because it started by explaining the forum structure, but usually I just discard confirmation/welcome messages.

Next they explain what you actually need to do to refresh the page with the last messages. Believe it or not, you have to send an empty message: just keep the text box empty and click the send button, labeled “On AIR” (yes, in English).

I heard that the forum has some pretty good content, which is of course the most important thing, but that still doesn’t mean that usability can be left on the last place.


Upgrader usability

May 27th, 2007

So easy to implement, so important for the users and yet always misdone: the upgrader.

What it should do (and all it should do) is to find out if a new version of the application is available and do any necessary changes to the system to make the new version usable. This could include downloading the whole new version, downloading an archive containing only the changed / new files, modifying the database structure or modifying configuration files / registry settings. It’s a straightforward four-step process summarized below:

  • Check for new version
  • Download required data
  • Apply required changes
  • Launch the application

And still many applications fail to have this “feature”.

Actually the only perfect upgrader I saw is the one of .NET Reflector (the tiny utility that lets you browse inside .NET assemblies and decompiles them on the fly). This is how it works (from a user’s point of view): you launch the executable, if there is a newer version available it asks you if you wish to upgrade; clicking “yes” will just pop up a progress bar and finally launch the new version.

The most commonly used pattern is to tell the user that there is a new version available and that they should download it and install it. I don’t really like this. When I see such a message, I start procrastinating the upgrade. I always feel there is too much hassle in going to their download page (bonus points if they include a link in the upgrade message), downloading the installer and finally running it - all this when I could just do my work. I also have all kinds of thoughts like what if the installer doesn’t know to install the new version over the old one, what if uninstalling the old version first looses my configuration, etc… and all this only to get some obscure new feature I would never use.

The worst is when some people believe that their application is the most important piece of software on someone’s system and that it deserves the whole attention and patience of the user.
Adobe Reader is the worst example. They have a whole separate program to manage upgrades (which starts when you launch the reader, but you can also start it from the start menu in case you really want to). You are presented a list of available upgrades and you are allowed to choose any of them to download and apply. Now that’s an astronautic architectural masterpiece. One time I decided to install those upgrades, just to make the whole thing shut up. Guess what. It started to download 40 MB! Wow! What upgrade could that have been when the whole Foxit reader fits in a less then 2 MB download?