Working on an illustrated explainer with on how JavaScript proxies are like a magician performing tricks.
Took me ages to wrap my head around them, but the metaphor helps a ton. Will hopefully clear up the mysticism for others as well!
#javascript #proxies #js
Conversation
Not saying Proxies are bad (I use them sometimes) nor explanation but with time I learned to be careful about any programming concept promoted as "magic" or "tricks".
1
The metaphor is a "magic trick". Doing a basic mutation, etc, then the proxy performing something out of the ordinary with "sleight of hand".
It's not a perfect metaphor, but I like it.
1
Yes I got it and that's what I'm careful about: "performing something out of the ordinary".
That's the case for proxies, they can easily have unexpected side effects.
They are very cool and sometimes help you implement thing in a simpler way, but to should be used with care.
1
Just like magic ๐๐ฎ
With great power comes great responsibility (to not write dangerous proxies)


