4 ms·
One nice feature is writing your class interface/implementation all as one and the system splitting it into .h .and .cpp. Especially if it can be set to do thin
by jakear 9y ago
One nice feature is writing your class interface/implementation all as one and the system splitting it into .h .and .cpp. Especially if it can be set to do things like the "pimpl" pattern.
I'm probably a minority in the C++ world, partially because I don't have a powerful IDE, but I tend to write everything in .h and only split it out later on, which gets annoying.
- ChrisSD 9y agoC++ is (hopefully) getting a proper modules system. So this should eventually be a problem of the past.
- jjuhl 9y agoThe work required to split things into .h and .cpp files is trivial and only needs to be done once. There's no need for a tool to simplify this 30sec step.
- stochastic_monk 9y agoI write template-heavy code, so most ends up being in headers anyhow.
- gmueckl 9y agoIf compiler times and ordering of declarations were easier to handle, I would probably change my code to live in headers only. Keeping headers and sources in sync is annoying. And the compiler also gets amazing optimization opportunities if it can see all of the implementation code.
- jjuhl 9y agoAs far as optimizations go, LTO (Link Time Optimization) solves a large part of that problem