230
True Story
(lemmy.world)
Post funny things about programming here! (Or just rant about your favourite programming language.)
Why are you putting the implementation in the .h file? You're supposed to declare in the header and implement in the .cpp files. The meme is reversed
The reason is that header files are pretty much copy/pasted into your c files when you include them. so the code in them keeps getting recompiled for every c file, which drastically increases overall build times. If you only declare in the header and have one c file implementing the functions you compile them only once.
oh wow. from 0ms all the way up to 0ms. That's almost 1000 times faster wow.
truly spoken like someone who has never worked on a large C/C++ project
thank god