17

I'm finishing up my app for iPad, and the filename extension (used mostly so that Mail and Dropbox know what program to open the files in) is 12 characters long. The only filename extension that is anywhere near as long is tax2010. Why is there so little variation on this topic, and what kind of problems can I expect by using a long filename extension for my app? These files will be mailed, copied, and shared*.

In all tests, it works perfectly.

* I hope.

  • 2
    I've seen a few more file extensions that long (just a few hours ago while browsing a Visual Studio project: .resources and .csproj). But yeah, most file extensions are shorter. – user7043 Dec 21 '11 at 17:42
  • 14
    Historical bias from the days of yore when storage and processing power weren't as plentiful. – Anthony Pegram Dec 21 '11 at 17:43
  • 1
    No, actually, historical bias from the days when we did not have command-prompt autocomplete. You know how programmers are oh-so bored to hit keystrokes. – Mike Nakis Dec 21 '11 at 18:15
  • 2
    There is no such thing as a file extension, at least not in more recent operating systems. – Ingo Jul 17 '13 at 14:50
  • 1
    @Zack Please tell me what exactly in the sentence "There is no such thing as a file extension." you didn't understand? By the way, it should be "file name extension". But even then, in more recent operating systems, like UNIX, it is at best a convention that a file named file.c contains C source, etc. There is no place in the OS where a filename is interpreted. – Ingo Oct 27 '14 at 18:36
20

A lot of developers were at least using computers back when long extensions where a technical restriction. Even today, there are still programs in active use that choke on things such as spaces in file paths and long extensions.

As long as you don't suspect that your files will need to be used by these programs, there isn't a technical reason to stop you.

Do please remember though, that the short extensions that can be comprehended in a single glance will be much better for your users. So while .resources is a great example, .customhatbymycompany is definitely not.

  • 1
    What about .customHatByMyCompany or .custom_hat_by_my_company ? <evil grin> Or even .custom hat by my company (both Windows & Linux seem to have no problems with spaces in file name extensions) – Mawg says reinstate Monica Feb 6 '15 at 15:33
8

File extensions are used to distinguish between different types of files, not to tell a story. That's why they are short: even with three letters length, the chances to have a collision on the same machine are pretty small.

Long extensions mean less space for the remaining path and file name. Maybe in modern operating systems and software it doesn't matter since they accept very long file paths. Sadly, this is not the case with Microsoft, where .NET Framework still cannot manage paths longer than 259 characters. 12 characters taken for extension means 246 characters left for the path without extension. In some cases, it may be a problem.

Since this issue does not apply in your particular case, the only reason to avoid long extensions is if file names, including extensions, are typed by the user, especially on mobile devices where typing can be hard.

8

Longer filenames:

  • Take more typing, resulting in more effort / misskeys
  • Take up more screen space
  • Are a break with tradition
  • Are not important because file extensions are for machines not people
  • Take up valuable characters in systems with a restriction on path length

Whether or not these considerations are a problem for your application is a matter for you and your users.

  • 8
    I disagree with your fourth point: extensions have normally had human associations. An operating system doesn't care if an executable is .exe or .df, after all, as long as there's a convention. Such extensions as .cpp, .jpeg, and so forth are designed for easy human reading. – David Thornley Dec 21 '11 at 20:44
  • 2
    @DavidThornley: It is arguable that,iIn modern versions of Windows, file extensions are hidden by default, so are not meant to be seen by "normal" users. However, in many other cases I'd agree that this isn't relevant - hence my disclaimer. – Kramii Dec 21 '11 at 22:39
7

As @Anthony said in the comments, a three letter (on DOS->Windows line) file extension is a historical remnant. Nowadays, it is no longer a restriction with modern operating systems, although it remains curiously common.

Since it is expected that, as time goes by, that practice will slowly be abandoned, I hazard that you could go with a longer file extension, especially if your tests confirmed that in your environment it "works okay".

The only problem that I can guess is that in some cases it will be shortened to "tax".

  • 1
    Thanks. Just to be clear, my extension is not tax2010, which is just an example of a longer one. – Dan Rosenstark Dec 21 '11 at 17:57
1

I can’t speak for iPad apps, but I’ve been using 5- and 6-character extensions for file types for my Windows apps for quite a while now with no problems. And I don’t think Linux ever had an issue with it, so it’s no problem there either. Just don’t use spaces or special characters, as some programs may not properly deal with them if they try to use the file name as part of a command line parameter.

Not the answer you're looking for?Browse other questions tagged or ask your own question.