Hacker News new | past | comments | ask | show | jobs | submit login

> con: "finally" puts the cleanup code at the end of the function. With "defer" you have it scattered at the beginning.

I would consider this a 'pro' as each action and defer are paired, executes in reverse order and a conditional action/defer doesn't need a second matching check.




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

Search: