News for hackers. Stuff that matters.
Re:Will you hire this guy? by vskarine on Friday April 01, 2016 @09:32PM (#11409793)
Agree with you. My first job out of college was working with C code on embedded modem software and when I saw this pattern and was like WTF?! but then realized how useful it is to have single point of exit in a function (especially in embedded systems code).
Re:Will you hire this guy? by Gibbon1 on Friday April 01, 2016 @09:42PM (#11409829)
Often it's very useful to have separate returns from functions for errors. The reason being you can set a break point on the error return and then let the code run. The code will run normally until the error occurs, which in some cases may take days.