Many moons ago when I started learning algorithms, I had just learned recursion and was feeling like a Jedi. You know what they say?: "if all you h...
For further actions, you may consider blocking this person and/or reporting abuse
The point about people not using it is not quite right.
But people don't quite use it in JavaScript indeed. JavaScript is a frontend language after all, at least it was initially meant for it. Right before React, frontend was driven by "dirty", functionally impure things like jQuery.
Memoization is only possible in pure environments. Thus, it was receiving almost no traction whatsoever.
Aside of JavaScript, look at the functional landscape β people thrive on memoization in lisps, as well as on lazy evaluation, pattern-matching and other good old functional things.
Good things to come βΒ modern frontend is moving towards functional concepts.
Memoization and other good things are to be resurfaced.
@akashkava
Thanks a bunch for your input. You nailed the point. Because Javascript is easier to get started with it, it's easier to keep doing the dirty stuffs. But even at the moment React implements meomoization with React.Memo and stuffs.
I believe the word is called
caching
and its very old technique, but yes, people don't use it !!Caching and memoization are related, but not the same. Caching is mutable, and generally constraint in size or time.
Catch invalidation is a thing, memoization invalidation is not.
In most cases you want caching. Only in certain algebraic cases you want memoization.
Yea, you are correct. It's similar to caching but not exactly the same.
Great post!
Wow, there is so huge difference between them.
I've never heard the memoization term before. Thanks, it was great!
Great write up and use case for memoization. Amazing to see what a difference it can make when used in a use case like this. π€―
I love all the personality in your article π Very helpful too, thanks.