4 ms·
I didn't understand what was special/novel about Proxies at all.
by zmanian 13y ago
I didn't understand what was special/novel about Proxies at all.
- kevingadd 13y agoProxies basically paper over the numerous weaknesses in Javascript's design by exposing named hooks for things like function calls and property accesses. It's not special or novel - in a language like python the equivalent is mundane things like naming a method __add__ or __getattr__. It's important for JS, I suppose, because without it a bunch of interesting metaprogramming techniques are impossible and you end up with inferior APIs that have worse performance characteristics. On the other hand, Proxy will probably be slow forever like all corner case JS features, so you really only win on API quality here :( EDIT: I should mention that Proxies do have some really interesting use cases; sadly the linked post does a terrible job of illustrating any actual reason you'd want to use them.