Hacker News new | past | comments | ask | show | jobs | submit login

> Headers and C style macros are probably the most unfortunate aspects of C (and by extension, C++).

Headers only became a massive problem in C++ because of templates and the unfortunate introduction of the inline keyword (which then unfortunately also slipped into C99, truly the biggest blunder of the C committee next to VLAs).

Typical C headers (including the C stdlib headers) are at most a few hundred lines of function prototypes and struct declarations.

Typical C++ headers on the other hand (include the C++ stdlib headers) contain a mix of declarations and implementation code in template and inline functions and will pull in tens of thousands of lines of code into each compilation unit.

This is also the reason why typical C projects compile orders of magnitude faster than typical C++ projects with a comparable line count and number of source files.




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

Search: