4 ms·
Context managers: exist. JS: drop but we couldn't occupy a possibly taken name, Symbol for the win! It's hilariously awkward.
by bvrmn 1y ago
Context managers: exist.
JS: drop but we couldn't occupy a possibly taken name, Symbol for the win!
It's hilariously awkward.
- demarq 1y agonah, Symbol has been traits for javascript for quite a while eg. Symbol.iterator It's the "dispose" part where the new name is decided.
- rounce 1y agoTraits in the way that a roller-skate is a car.
- masklinn 1y ago> JS: drop but we couldn't occupy a possibly taken name, Symbol for the win! You're about a decade late to the party? That is the entire point of symbols and "well known symbols", and why they were introduced back in ES6.
- bvrmn 1y agoAnd I didn't use it because there was no need. Resource scoping is important feature. Context managers (in python) are literally bread and butter for everyday tasks. It's awkward not because of Symbol, it introduces new syntax tied to existing implicit scopes. It's kinda fragile based on Go experience. Explicit scoping is a way more predictable.
- deleted 1y ago[deleted]