I’m new to C++, previously mostly using Java and Python.
I’ve found that it’s typically more convenient to put a class in a .hpp file so I don’t have to update the interface and functions in both the .h file and the .cpp file when working on a project. Is that bad practice?
I’ve heard that using .h files and .cpp files can help avoid code bloat as the compiler doesn’t have to copy the functions at the top of every file that includes them. I’m wondering if that’s really a significant concern or not though.
If it’s not, I’m thinking of defaulting to using .hpp files for most classes and structs, and then just using the .h + .cpp file combo when I want to have a more defined interface. Any thoughts?
1