proposal-function-once
proposal-function-once copied to clipboard
Goal priorities: First principles versus userland precedent
A common dilemma that has been recurring in #2, #3, #4, and #5 is which is more important in design:
- First principles? (E.g., “Once-side-effect functions should be idempotent on multiple calls.” https://github.com/tc39-transfer/proposal-function-once/issues/2#issuecomment-1083418305)
- Userland precedent? (E.g., “Because [insert library here] does this behavior, precedent blesses it, and changing it will make it more difficult for developers to adopt the native.” https://github.com/tc39-transfer/proposal-function-once/issues/2#issuecomment-1083345080, https://github.com/tc39-transfer/proposal-function-once/issues/5#issuecomment-1083346561)
@ljharb, @jridgewell
I think that in language design, we should always come up with our most ideal solution first - and then, compare/contrast it to what other languages, and userland, are doing. That doesn't mean we should ignore precedent, but it does mean every sacrifice made to match precedent should be done intentionally and carefully.