I am wondering which code style is better for
Let's imagine we have 2 functions:
// first one
void foo(void) {
if (error)
exit(1);
....
}
// second one
void bar(void) {
if (!error) {
....
}
else
exit(1);
}
Both of them work in the same way in terms of execution, but which code style is preferable?
If I had to choose out of these two only, I'd choose the first one.
Reason:
Hence, first one is preferable.