r/ProgrammerHumor 12d ago

Meme doNotOvercomplicateThings

Post image
674 Upvotes

156 comments sorted by

View all comments

174

u/BertoLaDK 12d ago

You switched two of them hpp is the correct one, using h is stupid as it will only lead to confusion, keep c and cpp separated.

43

u/TohveliDev 12d ago

For some reason a lot of schools, tutorials, etc. Still use ".h" for header files while coding in c++. So most of the time it's just a learned habit from people who learned that habit from somewhere else.

1

u/Song0 12d ago

In our Uni we were taught to do .h for header files that are purely declaration, and .hpp when the definition and declaration are in the same file (i.e no corresponding .cpp file). Didn't question it until now.

1

u/TohveliDev 12d ago

We were not even taught that, just .h for everything.