3 ms·
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
by vskarine 11y ago
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).
- Gibbon1 11y agoOften 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.