Written January 26, 2016. Tagged Ruby.
"Memoization" is caching the results of expensive method calls for speed.
In Ruby, this is often implemented something like this:
@my_expensive_method ||= one + two * three
@my_expensive_method ||= begin
Clearly this needs a name.
I've always thought of it as "rose memoization", because of the
@ ||= pattern. It looks like an ASCII rose.
I was amazed not to find any (any!) Google results for that term, so now this post exists.
Are there any other terms in use for this construct?