2 ms·
Since code could be self-modifying; clearly simple-data access has never been a guarrantee. But in practice, today as ever, it's a good guideline. When you se
by emn13 13y ago
Since code could be self-modifying; clearly simple-data access has never been a guarrantee.
But in practice, today as ever, it's a good guideline. When you see an accessor, it will almost always be fast and side-effect free.
Now, part of that is because not all browsers support the features you refer to and therefor these features just don't get used much. But even in languages like C# and python, that have had real accessors for a long time, it's still a good guideline: it's generally considered bad practice to make a slow, side-effectful accessor, and most people don't.
Controlling side effects and performance are important, and the uniform access principle has little upside in most non-public code, yet considerable cost in that it obscures one of the few indicators mainstream languages have for these aspects.