3 ms·
> it infects more than just the place you need it — you almost always have to add it upwards and downwards > Cancellation/timeout is arguably so core to the la
by infogulch 8y ago
> it infects more than just the place you need it — you almost always have to add it upwards and downwards
> Cancellation/timeout is arguably so core to the language that it should be an implicit part of the runtime
This is exactly what I mean, thank you for putting it so succinctly! I would go even further to claim that Go 1 goroutines are fundamentally incomplete due to missing this ability to control their behavior from the outside, and context is an attempt to paper over the missing functionality.
The key-value store built into them is also an attempt to paper over a large gap in the language: the absence of GLS (goroutine-local storage :P).
That context combines two ugly coverups of major deficiencies with the fact that using it means doubling almost all apis and infecting the whole ecosystem is why I dislike it so much.
- atombender 8y agoAgreed. Thread-local storage has rightly been criticized as a bad idea, but Go'a contexts are arguably worse. It'd be easier if Go has something like Scala's implicits.