3 ms·
I don't think file number / lines of code is a good measure, you can have perfectly readable code in a single file that is 1000s loc. There are plenty single he
by chutsu 5y ago
I don't think file number / lines of code is a good measure, you can have perfectly readable code in a single file that is 1000s loc. There are plenty single header file libraries that are larger and are very useful. Perfect example is the stb libraries: https://github.com/nothings/stb https://github.com/nothings/stb
very widely used in the C / C++ community.
- rowanG077 5y agoThey are single header for a single reason: Dead easy to distribute. > You can have perfectly readable code in a single file that is 1000s loc. You can if you are dealing with a single concept. JSON parsing is not a single concept. You can easily split that up into more understandable modules. In fact I would wager that any JSON library that has not modularised serialization, deserialization and object building/modification into modules is not doing a good job. It's not like more c files cost anything. It's not comparable to header-only libs since they will compile to an object file anyway.