Thursday, February 21, 2008

Hiding Things from Users

Microsoft Windows has a "clever" feature which hides the extensions (or suffixes) of files. So, if you have a file named "example.gif", Windows will show you the name as "example". Unfortunately, if you also happen to have a file named "example.doc", Windows will also show its name as "example", making it look like you have two files with the same name.

In general, hiding things from users isn't a good idea. I've never understood why Windows has this feature (worse, it's on by default and the way to turn it off is buried, in the View tab of the Folder Options dialog box, so a lot of users don't even know it exists).

Here are some theories:

  • Macintosh envy. On the Macintosh, filenames have types which are independent of the name. So, you can have a document named "example" rather than "example.doc". It seems friendlier to not have extensions. But, Apple did it right -- the filename actually is "example" and you can't have two files with the same name.

  • Fake security. If the extension is hidden, users can't change it , which means they can't turn a TXT file into an EXE. Unfortunately, this opens a security hole. If you name a file something like "example.jpg.exe", Windows will show its name as "example.jpg", which everybody knows is a picture, not a program. It can't be dangerous, right?

    Malware has exploited this Windows feature.

  • Simplicity. Users are just confused by all those extensions -- let's hide them. This is like lipstick on a pig. The extensions are an essential part of the way Windows works. That's unfortunate, but true. Hiding the extensions increases complexity by introducing something that users frequently need to know but they cannot see.
There is one legitimate reason for hiding the extension that I can think of and that relates to the second point above -- it's way too easy for users to accidentally change the extension of a file and doing so will make the file (temporarily) unreadable. That's a valid concern.

It's an important enough concern that Windows has dealt with it in another place. When you rename a file in a folder window, Windows checks to make sure that you're not changing the extension. If you do, you get this warning:

How many times have you seen (and been annoyed by) this dialog? I see it all the time because I'll type a new name and forget to retype the extension. And, making matters worse, most of the time, neither Yes nor No will do what you want. Clicking Yes will continue the rename, forcing you to rename it a second time to get the extension back. Clicking No, discards whatever you just typed, which you probably want. I want the "let me type the extension now" button.

Fortunately, the basic problem can be fixed with a very simple change based on a very simple principle:
  • Don't expose your schema.
A schema is the definition of how a system is designed and structured internally (these days, you'll most often hear the term schema used to refer to a database definition). But what you show users doesn't have to have anything to do with your schema. On the Macintosh, the filename and file type are two different file properties. On Windows, they are one property. Neither of these facts has to have anything to do with how they are shown to or edited by users. Both systems should do it in the way that works best for users.

The vast majority of the time (I would guess >99%) of the time, when a user renames a file, they don't want to change the extension. This makes it pretty clear that the Rename operation should only rename the base part of the filename and not the extension.
For those users who need to change an extension, an alternate option can be provided on the right click menu. And for those still using DOS commands, it should keep working the way it does -- this is about UI, not batch scripts.

Extra point. I got inspired to write this post last night when I was helping a friend over the phone. He needed to change the extension of a file but couldn't until he turned off the option (which is something I recommend everybody do). Unfortunately, he is using Microsoft Vista, which has cleverly hidden the Tools menu in folder windows. A quick Google search told me that it will magically appear if you hold down the Alt key. What were they thinking?! What else have they hidden?

In summary:
  • Try not to hide information from users, especially information they need to know anyway.
  • Don't expose your schema.
  • If you realize that you have a very common use case, optimize for it.

3 comments:

stephen matlock said...

You forgot point 4:
1. If you've done something stupid, like not deeply thinking about how to make Windows more than a DOS shell, then fix the problem as soon as you find it, rather than keep trying more and more cumbersome methods to cover up the real problem.

Your solution of just renaming the file name part of the file is an example of looking at the original use case to ask "What is the user really trying to do? What are the chances the user is trying to rename the file extension?"

The explicitness of the file extension (vs the method Macintosh uses to decide the file type) is a holdover of DOS. Windows was, frankly, stupid not to fix this problem right away. And they've compounded it over the years, releasing version after version full of new irritating features w/o rethinking some of the original stupid design decisions.

For goodness' sake, the file type is embedded (in most newer apps) in the file itself. When storing the file, the OS can look at this to determine the file type and use that to set the file icon.

Is is useful to be able to rename an HTML file as a TXT file temporarily so you can open it in Notepad by double-clicking? Sure, but that is (a) an extreme edge case (not many users really need to do this) and (b) it is something that can be accomplished by right-clicking and selecting "Open With."

A better solution is simply to hide the extension and treat it as if it were an interesting factoid about the file. If you really need to change the extension, do what you suggest & add it as a right-click feature to say "Pick a different type for this file."

Derrick said...

I think the Mac file type thing is on the way out. I believe that native OS X apps no longer create the old type/creator duet, and files now have extensions that act like normal file extensions. By default, they are hidden, but it's easy enough to turn them back on (as I do).

So it would be "Mac OS 9 envy" and not "Macintosh envy."

Pavel said...

ojkesActually, the option isn't quite as hidden on Vista as you think; it's under the "Organize" / "Folder and Search Options" menu item.

I know this because, like you, it's the first option I change on a new machine.