tc39 / proposal-immutable-arraybuffer

A TC39 proposal for immutable ArrayBuffers
http://tc39.es/proposal-immutable-arraybuffer/
MIT License
12 stars 1 forks source link

`.immutable` or `.mutable`? #10

Open bakkot opened 2 weeks ago

bakkot commented 2 weeks ago

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 commented 1 week ago

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 commented 1 week ago

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.