Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm finishing up my app for iPad, and the file extension (used mostly so that Mail and Dropbox know what program to open the files in) is 12 characters long. The only file 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 file extension for my app? These files will be mailed, copied, and shared*.

In all tests, it works perfectly.

* I hope.

share|improve this question
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. –  delnan Dec 21 '11 at 17:42
11  
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
    
There is no such thing as a file extension, at least not in more recent operating systems. –  Ingo Jul 17 '13 at 14:50

6 Answers 6

up vote 7 down vote accepted

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.

share|improve this answer

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

Since it is expected that as time goes by, that practice will slowly be abandoned, I chance that you could go with a longer file extension, expecially 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".

share|improve this answer
1  
Thanks. Just to be clear, my extension is not tax2010, which is just an example of a longer one. –  Yar Dec 21 '11 at 17:57

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.

share|improve this answer
1  
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
    
@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

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.

share|improve this answer

File extensions are a rudimentary form of metadata about a file. Hopefully someday we'll move away from archaic naming conventions and start storing more metadata as file attributes.

share|improve this answer
    
Metadata is fine, but its hard to beat the simple convenience of looking at a file name and knowing what type of file it is. –  GrandmasterB Dec 21 '11 at 19:32
1  
File extensions also allow the same folder to contain "foo.dll" and "foo.pdb". If you try to replace that system with naming each file just "foo" with meta data indicating that they are respectively compiled code and metadata about that code relevent to debugging, you get a name collision. –  JGWeissman Dec 21 '11 at 19:40
    
MacOS, before MacOSX, had two four-byte fields in each file to identify file type and application it belonged to. The user would determine file type from the icon. –  David Thornley Dec 21 '11 at 20:48
1  
Fascinating, but is it an answer to the question? –  Yar Dec 22 '11 at 21:43

I cant 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 dont think linux ever had an issue with it, so its no problem there either. Just dont 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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