4 ms·
I see, very interesting. Personally, I'd prefer to just have a "finally:" label; I've never liked "try", because it seems like extra boilerplate, and forces an
by shiroiuma 3y ago
I see, very interesting. Personally, I'd prefer to just have a "finally:" label; I've never liked "try", because it seems like extra boilerplate, and forces another level of indentation.
- DaiPlusPlus 3y agoI like how Swift did it: instead of try/finally, they have `defer`, which (when encountered) pushes a new clean-up task to the guaranteed-execution list in the right order: https://www.hackingwithswift.com/new-syntax-swift-2-defer https://www.hackingwithswift.com/new-syntax-swift-2-defer
- shiroiuma 3y agoThat does sound good. It looks like golang has the same type of construct.