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

C# used to require blocks, but as more and more things needed to be disposable you'd often find code bases winding up somewhat unreadable "waterfalls" of blocks, for various reasons. Languages automatically track the scopes for a lot of things, especially in the cases of async/await functions and generator functions which build complex state machines. Automatically tracking the scopes of using statements isn't that much different than tracking let/const through all of a function. Some languages make that explicit, too. (The most common LET in LISP requires explicit "blocks", as an example.)


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

Search: