Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Context managers: exist.

JS: drop but we couldn't occupy a possibly taken name, Symbol for the win!

It's hilariously awkward.



> 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.


And 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.


nah, Symbol has been traits for javascript for quite a while eg. Symbol.iterator

It's the "dispose" part where the new name is decided.


Traits in the way that a roller-skate is a car.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: