Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are plenty of file formats that have multiple extensions in common use. I can think of a few off the top of my head:

- .jpg / .jpeg

- .tif / .tiff

- .htm / .html

- .cpp / .cxx

It's frustrating at times, but not all file formats have One True Extension.



Most of these are Microsoft's fault: MS-DOS allows only 3 characters for the file extension, so the file extensions had to be abbreviated.

As for C++, I'd also blame Microsoft. The plus character (+) is a reserved character for MS-DOS, so the obvious extension ".c++" couldn't be used (nor could the case-sensitive ".C" extension). So people either toppled their plus signs (".c++" becomes ".cxx"), or replaced them by the first letter of "plus" (".c++" becomes ".cpp"), or treated them as a repetition sign (".c++" becomes ".cc").


C++ is the worst offender: .cpp, .cxx, .cc, .h, .hpp, .hh, etc.


I've even seen .c++/.h++ in the wild at least once.


Could be worse, could be uppercase .C/.H…




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: