3 ms·
Given that the whole framework is in roughly 31kloc of C++ written mostly by you and this not your first framework. Can you talk more about your design choices,
by sitkack 6y ago
Given that the whole framework is in roughly 31kloc of C++ written mostly by you and this not your first framework. Can you talk more about your design choices, what the architectural patterns are and how metaprogramming plays a role [1] ?
Besides your experience from writing Silicon [2], what other frameworks do you like the design of? What C++ codebases do you like or find interesting from a design perspective?
[1] https://github.com/matt-42/iod https://github.com/matt-42/iod (merged into Lithium)
[2] https://github.com/matt-42/silicon https://github.com/matt-42/silicon
- matt42 6y agoI think I need to write a blog post to do a retrospective on what I learned writing iod, silicon, lithium (and vpp, a small image processing lib). There is so much to tell. Just to be short, here is my phylosophy: - don't think too much when you write it the first time, just do it quick. Do all the mistakes and ugly code first and then rething/rewrite things when it can actually simplify the codebase. Big refactors are much more productive and successful than big premature design thinking. - Only expose the complexity that the user need. Simple things should stay simple even if we can do more complex stuff. Look for simplicity everywhere. - Profile before optimizing, the bottleneck is never where you think it is. For you question about metaprogramming, it is used yes. The core of the framework is build around a compile time key/value map that unroll json and get/post parameter de/serialization at compile time [1] so no dynamic dictionary involving costly malloc is needed. [1] https://github.com/matt-42/lithium/tree/master/libraries/metamap https://github.com/matt-42/lithium/tree/master/libraries/met...