Skip to content
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

.immutable or .mutable? #10

Open
bakkot opened this issue Oct 10, 2024 · 2 comments
Open

.immutable or .mutable? #10

bakkot opened this issue Oct 10, 2024 · 2 comments

Comments

@bakkot
Copy link

bakkot commented Oct 10, 2024

Generally I try to make my boolean options and properties positive. Arguably, immutable is the negation of mutable. Following that principle, then, the getter should be spelled mutable, and to check for immutability you'd negate the result.

I don't feel strongly about this, but it's something to think about.

@phoddie
Copy link
Collaborator

phoddie commented Oct 16, 2024

A nice side effect of immutable is that engines which don't implement this property will give the expected result for...

If (ab.immutable)
   ;

...since since immutable will be undefined.

@gibson042
Copy link
Collaborator

Right; there's a tension here between "booleans should default to false" (which favors immutable) and "booleans should be named with positive polarity" (which favors mutable). I'm fine either way, but more inclined towards immutable.

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

No branches or pull requests

3 participants