3 ms·
This is a trick that makes the experience of writing C and C++ code much better: Skip the header files and include the .c or .cpp files into one translation uni
by robalni 4y ago
This is a trick that makes the experience of writing C and C++ code much better: Skip the header files and include the .c or .cpp files into one translation unit instead.
* No more code duplication every time you change the type or name of a function.
* Fewer files and less code.
* Tab completion works better for the file names (you don't have two files that start with the same name)
* Only one place to put the comment if you want to document the function (otherwise the comments are easy to miss if there is a description in the header file but I'm looking at the definition).
* The code usually compiles faster.