Hacker News new | ask | show | jobs
by matt42 2113 days ago
I 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/met...