keithamus / proposal-object-freeze-seal-syntax

A JavaScript TC39 proposal for Object.freeze & Object.seal syntax
https://www.keithcirkel.co.uk/object-freeze-seal-syntax
59 stars 8 forks source link

Freeze as the primary syntax #23

Open guybedford opened 5 years ago

guybedford commented 5 years ago

In thinking about the syntax, with both seal and freeze as the variations, it's worth thinking about aesthetic precedence.

For example, {# obj #} might seem less aesthetically pleasing to most than {| obj |} (while this is subjective, there's likely a rough average towards the latter due to greater shape congruence between the different symbols in this case).

For this reason, and with these examples, I would suggest that freeze should be the priority aesthetic. For the reason that the guarantees of freezing provide the most useful correctness and security guarantees.

So effectively I would be suggesting with the current syntax that they should be swapped around in meaning - {| |} for freeze, and {# #} for seal.