Home Projects Philosophy Hobbies About Me Updates

Comfortable Counters

There is a nice trick one can use when designing interfaces. When you have several groups, or categories, or topics, or sections to choose from (only one of them can be displayed), or even if you only have one, but it's not displayed all the time (for example, a shopping cart at an online shop site), it is good to display the number of items they contain right beside their names. The number of items overall, or the number of unread items, or any other status indicator that may be relevant. This way you don't have to click on each and every group to see if something changed – the changing numbers will tell you.

For example, consider the shopping cart. When you click on the add to cart button, you want to see that the item was indeed added to your list. If the button was any more complicated, you also want to make sure that the correct amount was added. Some online shops will just move you to the cart page after you clicked – otherwise, you will go there yourself anyways, because you want to make sure. Then you have to hit the back button, or even worse, navigate back to to where you were, to continue shopping. Or you may just decide that's enough shopping for today, which is even worse for the shop. But if there is a counter next to your shopping cart link, and it is updated properly after you click – you are fairly sure the button worked as you expected, and you can proceed with shopping.

Another use for the counters is a little more internal. I've seen it in some custom-written forum software. Very simple, yet very functional one. It was an anonymous forum (you could sign your posts if you wanted), without any logins. But having no logins and no user information stored meant it didn't know which threads contain posts that the user didn't read yet. It could use cookies, and store the information in format similar to the .jnewsrc file of slrn, but this is complicated and could easily grow beyond the allowed 4kB. This particular piece of software used a functionality that's build in web browsers specifically for that: visited links. Obviously, the links to pages you've visited are marked as "visited" automatically. You don't need any code for that. All you need is to make sure the links get "unvisited" when the pages change. And that's where counters come in handy – the links to the thread pages contained a parameter, for example &posts=3. This parameter wasn't used anywhere. It was there just so that the link changes every time a new post is made – so it gets "unvisited". Simple yet brilliant.