3 ms·
Implicit parameter smuggling by any mechanism is just too much magic in my experience. Golang's context.Context solves the same problem, but explicitly in a way
by bhawks 1y ago
Implicit parameter smuggling by any mechanism is just too much magic in my experience. Golang's context.Context solves the same problem, but explicitly in a way that has been widely adopted through their language ecosystem.
That said - in Java I do think it would be near impossible for the ecosystem to adopt a similar mechanic, so from a practical standpoint this may be the only way to reliably propagate context.
- kuekacang 1y agoI think it is due to java already featured the threadlocal mechanism so the ecosystem get used to it. I just recently rediscovering java (w/o framework) when virtual thread landed and I gravitated towards context passing. Even more recently I started reading golang code only to then seeing they were doing the same thing.