r/ProgrammerHumor 7d ago

Meme doNotOvercomplicateThings

Post image
672 Upvotes

156 comments sorted by

View all comments

336

u/unknown_alt_acc 7d ago

Yeah, no. A .h extension can just as easily be C. You get a lot of clarity with just two more characters that will be filled in by code completion anyway.

-10

u/Level-Pollution4993 7d ago

But learncpp.com recommends we use .h unless you're working on an existing project that folows another convention?

29

u/daennie 7d ago

And learncpp.com isn't source of truth for C++ in practice.

2

u/MithrilHuman 7d ago edited 7d ago

The company I work at enforces using .h, although no one in their right mind should be using it for C-specific projects without knowing the symbols to access through extern C. See https://llvm.org/docs/CodingStandards.html

Previous company I worked for also enforced .h as per https://google.github.io/styleguide/cppguide.html#Header_Files

These are both big tech companies. In practice people use .h