by spion · 10y ago · 0 comments
Also, all of the examples given there can be implemented more elegantly using decorators.
The more useful cases are dynamically generated method names (e.g. for ORMs) and array index access (e.g. MobX) for non-array datastructures, both of which could've been handled with a less invasive language feature...
Method missing is an alternative to proxies, not a feature.
IMO, a lot of use cases for proxies are mistakes and/or better handled without them.
@observable isn't part of the language, and indeed may use proxies under the surface.
@observable does not need proxies. Only implementing operator[] does. Which also could've been done with a far more limited feature, namely adding a symbol for the [] method.
Proxies are just silly.