News for hackers. Stuff that matters.
Re:GOTOphobia Considered Harmful (In C) by inlined on Sunday February 26, 2023 @05:58PM (#34950602)
I used to work at Microsoft on the windows team. There it was very common to have a “goto cleanup” for all early exits. It was clean and readable. Otoh, I once was assigned to investigate an assertion error in the bowels of IE layout code. It was hundreds of stack frames deep in a recursive function that was over a thousand lines long and had multiple gotos that went forwards or backwards. That was an absolute mess and would have been impossible to debug without an recording (“time travel”) debugger.
Re:GOTOphobia Considered Harmful (In C) by astrange on Sunday February 26, 2023 @11:28PM (#34952956)
Any API that returns error codes has that issue; if it just returns an int you can't just set a breakpoint on the "allocate an error" method.