News for hackers. Stuff that matters.
Re:Will you hire this guy? by wyldfire on Friday April 01, 2016 @09:17PM (#11409752)
`goto` to arbitrary labels can be pretty risky. But `goto` to facilitate a single-point-of-exit for a function is a pretty sane idiom. It's all over the linux kernel and I don't think that anyone regrets it.

So I wouldn't state something like "Even Linus isn't perfect," rather "you should be open minded to learn new development idioms in environments where you're less experienced."

Re:Will you hire this guy? by Gibbon1 on Friday April 01, 2016 @09:38PM (#11409817)
Check out the function it's from, it's a classic function with multiple guard exits and normal return at the end. The gotos to a label in an if block is what's amusing. But you can see why he's doing that, he has exactly one exit per returned error type.
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.