Re:C: Simple Defer, Ready to Use
by jefbyokyie on Monday January 06, 2025 @07:34PM
(#42617844)
> cleanup in every single failure case
you're only tempted to clean up [fully] in every single failure case if you don't know how to implement cascading gotos or the arrow pattern.
Re:C: Simple Defer, Ready to Use
by bangaladore on Monday January 06, 2025 @10:00PM
(#42618687)
I'll be honest that you are in the minority here.
goto is widely considered an anti-pattern and so is the arrow pattern.
Re:C: Simple Defer, Ready to Use
by jefbyokyie on Tuesday January 07, 2025 @01:09PM
(#42625386)
> you are in the minority here
Yes, I am.
Defer is a way better solution than having to cleanup in every single failure case.