|
|
|
|
|
by jdeaton
1592 days ago
|
|
goto usage in systems programming is actually much more prevalent and less of an anti-pattern/smell than in other contexts. This is because you often need to ensure every resource acquired during the function is cleaned up along each branch that the function could exit through. Because in systems programming you'll often do an operation, check if it succeeded and exit if not. The goto resource cleanup pattern avoids you having to duplicate the clean-up-partially-acquired-resouces at every early-return statement. |
|