Skip to content

“memo” versus “memoize” #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
js-choi opened this issue Aug 26, 2022 · 6 comments
Open

“memo” versus “memoize” #13

js-choi opened this issue Aug 26, 2022 · 6 comments
Labels
question Further information is requested

Comments

@js-choi
Copy link
Collaborator

js-choi commented Aug 26, 2022

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 js-choi added the question Further information is requested label Aug 26, 2022
@ljharb
Copy link
Member

ljharb commented Aug 26, 2022

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

@theScottyJam
Copy link

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.

@ljharb
Copy link
Member

ljharb commented Sep 4, 2022

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

@Andrew-Cottrell
Copy link

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.

@OmarCastro
Copy link

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

@TomokiMiyauci
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants