proposal-function-memo icon indicating copy to clipboard operation
proposal-function-memo copied to clipboard

“memo” versus “memoize”

Open js-choi opened this issue 3 years ago • 6 comments

Early bikeshedding. No matter what we decide in #2, we will need to decide whether we would rather call the new metafunction “memo” or “memoize”. I’m fine with either.

js-choi avatar Aug 26 '22 14:08 js-choi

ime "memoize" constantly tries to be autocorrected to "memorize", so i'd vote "memo".

ljharb avatar Aug 26 '22 16:08 ljharb

I kind of like it spelled out. But, I think that's mostly because I see and use it in its long-form more often than its short form, so that's what I'm comfortable with.

But, readability-wise, I could see people seeing the function for the first time, mis-reading it as "memorization" (really easy to do), and start trying to google for what the memorize function is.

I know some might vote for "memo" because it's a bit shorter, though I don't think that should be a strong concern - I would assume that most usages of memoization would require some extra options to be passed in, like customizing the caching strategy or configuring how it decides if two keys are equal - the extra baggage required to do all of this would certainly shadow the verbosity of the couple of extra "ize" characters, making them insignificant. But, perhaps I'm wrong about how often additional arguments will be necessary.

theScottyJam avatar Sep 04 '22 19:09 theScottyJam

Oh also, British people might try to use “memoise” :-p

ljharb avatar Sep 04 '22 20:09 ljharb

I prefer "memoize" as I understand the word "memo" to be an abbreviation of the word "memorandum".

I agree that similarity with the word "memorize" is unfortunate and could be an issue for those using the method for the first time (or two), but I expect this would be quickly overcome. With "memo", people might incorrectly think it is an abbreviation of "memorize" or "memorandum", so I believe it would be better to use "memoize" so they learn the correct word earlier.

As a British person who writes software, I have learnt to use the "ize" spelling in programming contexts; in both code and documentation (also "color" and "behavior" rather than "colour" and "behaviour"). Most programming languages and libraries use American English spelling and while that may impose a small burden on some, it is at least consistent. I don't think use of American English spelling should be a strong concern for this proposal.

Andrew-Cottrell avatar Sep 06 '22 11:09 Andrew-Cottrell

I too prefer "memoize". Memoization is a common technique with a known name. I think the British version uses the same name instead of "memoisation". And it is easy to associate "memoize" with the technique instead of memo. "memo" is commonly known an abbreviation of "memorandum".

Extending what @Andrew-Cottrell said, it would be easy to search what memoize is instead of memo, where you will mostly get results of papers and post-it's

But hey, "memorize" isn't a bad name since the idea is to "memorize" the value! :P

OmarCastro avatar Feb 10 '23 01:02 OmarCastro

I prefer short, but perhaps "memoize" is more appropriate for consistency with apply, call and bind. 

TomokiMiyauci avatar Jun 09 '23 09:06 TomokiMiyauci