3 ms·
Can't foo() call std.os.exit()? Then you don't know that bar() will always execute after foo() in Zig.
by chongli 3y ago
Can't foo() call std.os.exit()? Then you don't know that bar() will always execute after foo() in Zig.
- mtlynch 3y agoYes, but I don't really think of that as hidden control flow. I know that if foo() returns, bar() will execute next, but foo() might not return (due to panic, program shutdown, or infinite loop). From my experience, when there's surprising behavior in software, I've frequently been surprised by silent exceptions, but I can't think of any time when I was surprised by control flow because a function intentionally shut down the program.