by hliyan · 6y ago · 0 comments
There's a nice Ruby trick btw where you put significant precalculations in constants, since the value of a constant gets computed during program startup it still allow you to do work "up front" instead of during a web request.
(edit to reply since I can't reply to a reply to a reply)
Yep, it is very common in lisp/smalltalk environments to dump the state of the world to disk and re-load it later. This is one of those tricks that gets relearned every generation. :)
For bonus credit apply this analogy to docker images. :)
Imagine describing globals in C, Python, or JavaScript, or static fields in Java or C# as a "neat trick"...