I came across a few postings on another forum recently that debated which extension is correct and standard. From what I understand a .h header file is a C/C++ file while a .hpp is supposed to be a pure C++ file. I read that the Boost libraries (which I have yet to jump into) use .hpp extensions which is the future of the C++ spec. Is there any dominate preference out there or standard you see in place today? Advantages, disadvantages? I currently use .h.
The thing is, headers (any .h, .hpp, or any other extension I can't remember right now) are not compiled. They are only included by .cpps, so it doesn't really matter what extension they have, as long as the compiler knows it's not supposed to compile it.
Typically, C applications use .h and .c (or .cc)
C++ use .hpp and .cpp (pp = plus plus).
It comes down to where you work/study and the preference they have to naming conventions. You'll notice even compilers are moving away from the .h for C++ (e.g it's now #include <iostream> not <iostream.h>
And your right. Boost uses .hpp, but that's part of their convention.
The valid extensions (supported by GNU) for C++ source files are .cc, .cpp, .cxx, or .C. The extension of the header file doesn't matter because it is just inserted into the source file by the preprocessor.
There are times you want to distinguish between C and C++ headers. If you are using just one language, it doesn't really matter what you call your header files. But if you mix the languages in a library or application, it becomes important to seperate them.
You can probably reply on __cplusplus being defined, and make up macros that wrap ' extern "C" ' and such C++ specific content, but the languages have subtle differences when confronted with common code (the size of enums, treatment of const variables for example).
Back in the old CFront days, there was a .C and .H convention for C++ source and header files to avoid conflict with .c and .h for C. However, MS-DOS used a case-insensitive file system and so used .cpp and .hpp instead. Visual Studio's parser still recongnises .hpp and .inl as C++ files, so it's not a completely forgotten form.
I think, if you're programming in just C++, feel free to use .h header files like everyone else. But if you're mixing languages, use .hpp for C++ and reserve .h for C.
I also think it was a mistake to start using .h for C++ programs.