Discussion Overview
The discussion centers around the use of C++ header files with and without the ".h" extension. Participants explore the historical context, standards, and implications of using different header file conventions in C++ programming.
Discussion Character
- Technical explanation
- Conceptual clarification
- Debate/contested
Main Points Raised
- Some participants note that prior to the 1998 C++ standard, all C++ headers had a ".h" extension, while the standard introduced headers without the extension.
- It is mentioned that compiler-specific headers and user-created headers typically retain the ".h" extension, such as .
- One participant explains that standard C++ headers can be included without ".h" but require a "c" prefix, and that all standard functions now reside in the "std" namespace.
- Another participant emphasizes that the file suffix in #include statements is a convention, and the C preprocessor does not enforce any specific file naming.
- Concerns are raised about the potential for undefined behavior if a non-standard file with the same name as a standard header is included, particularly when using the angle brackets versus quotes in #include directives.
- There is a discussion about the implementation-defined nature of header file search paths and the guarantees provided by the C and C++ standards regarding header inclusion.
Areas of Agreement / Disagreement
Participants express a mix of agreement and disagreement regarding the implications of using ".h" versus non-".h" headers, as well as the guarantees associated with including standard headers. The discussion remains unresolved on some points, particularly regarding the best practices for header inclusion.
Contextual Notes
Some limitations are noted, such as the dependence on compiler behavior and the potential for undefined behavior when including headers with conflicting names. The discussion also highlights the historical evolution of header file conventions in C and C++.