Re:Show HN: Add a command-line interface to any C++ program
by moonchrome on Saturday October 16, 2021 @03:18PM
(#28890602)
Copy pasting shit in your repo means you are responsible for maintaining that code and need to keep track of upstream manually. Especially in c++ where memory bugs are prevalent, this sounds like a terrible idea.
Slow-compiling APIs can be made in any form, whether "header only" or not. C++ template APIs cannot be compiled separately and can cause long compile times for all transitively dependent translation units.
For example, stb_image.h is a single file that is 1 copy+paste from github away. It compiles quite quickly, and often you will need it alongside only a single .c file in your project, but anyway it's extremely easy to compile it separately. All you have to do is cut+paste the implementation part to a separate .c file.