![Cover of Large-scale C[plus plus] software design](/covers/OL2986364W-480.webp)
Even though compilation time is the bane of C++, I think this concern regarding this specific usage is grossly overblown. I'm going to tell you why.
With incremental builds you only rebuild whatever has changed in your project. Embedding JSON documents in a C++ app is the kind of thing that is rarely touched, specially if all your requirements are met by serializing docs at compile time. This means that this deserialization will only be rarely rebuilt, and only under two scenarios: full rebuild, and touching the file.
As far as full rebuilds go, there is no scenario where deserializing JSON represents a relevant task in your build tree.
As for touching the file, if for some weird and unbelievable reason the build step for the JSON deserialization component is deemed too computationally expensive, it's trivial to move this specific component into a subproject that's built independently. This means that the full cost of an incremental build boils down to a) rebuilding your tiny JSON deserialization subproject, b) linking. Step a) runs happily in parallel with any other build task, thus it's impact is meaningless.
To read more on the topic, google for "horizontal architecture", a concept popularized by the book "Large-Scale C++: Process and Architecture, Volume 1" By John Lakos.
Mountain out of a molehill.
*I have no association with him whatsoever.
* Fundamentals of Software Engineering by Ghezzi, Jazayeri and Mandrioli
* The Practice of Programming by Kernighan & Pike.
* Code Complete by Steve Mcconnell.
* The Unix Programming Environment by Kernighan & Pike
* Advanced Unix Programming by Marc Rochkind.
* C Interfaces and Implementation by David Hanson.
* Large Scale C++ design by John Lakos
* Unix Network Programming by Richard Stevens.
The key is that while reading the above you need to "get" how the code is "structured" rather than the details. For example, how does the code for a TCP server and client "look like"? It is a kind of spatial knowledge which you can then consider as one "module" of functionality and reproduce as needed. Large Systems consist of a bunch of layered and well partitioned modules exposing simple and clean interfaces. There will also be modules which cross-cut all the functional modules like "Error-Handling", "Logging" etc. This is the core of "Software Engineering", everything else is details.
Finally, you would also need to read a book/source where you can see all of the above principles put into practice while building a non-trivial (initially not overly complex) system.
Read John Lakos' "Large Scale C++ Software Development" as well as Scott Meyers' Effective C++ series.
"On C Library Implementation": http://rusty.ozlabs.org/?p=140
For such an important subject, there is little practical discussion or good examples of library design. Compare the number of books about C++ object-oriented design versus the design and packaging of C/C++ libraries.
The best reference I know is John Lakos's excellent (but ancient: 1996!) book on the subject: "Large-Scale C++ Design." Here are some excerpts from the book.
http://blog.codeimproved.net/2009/03/the-large-scale-c-softw...