Comment by zoezoezoezoe

Comment by zoezoezoezoe 2 days ago

3 replies

technically, "header only libraries" can be exceptions to C code not being in header files. See STB as an example https://github.com/nothings/stb. The advantage theoretically is that you can #include this library and use its code and types from just one file, its a decent model IMHO, but it can be jarring to someone unfamiliar with header only libraries.

uecker a day ago

They have plenty of downsides and only one very minor advantage: You need to copy only a single file instead of two into your source. I am still puzzled why anybody could think this is a good idea...

  • 1718627440 19 hours ago

    And you also can name your single file to be included .c instead of "hiding the truth".