4 ms·
As a part of the claimed "simplicity" of C is limited ability for hidden control flow in the language. The "nothing magical happens" is both a pro and a con of
by olodus 5y ago
As a part of the claimed "simplicity" of C is limited ability for hidden control flow in the language. The "nothing magical happens" is both a pro and a con of the language. Things work as described in the code, not as described in the lang spec. This lang limitation promotes simple and not over-engineered solutions. But as I said, it is not always a pro.
Btw I agree that UB can be dangerous and hard to debug. And that "nothing hidden" doesn't really hold because it can be really tricky sometimes to figure out what the compiler did.
When faced with these problems I don't say "you are coding C wrong" as some here claim we do. I would say that you need to be very careful when coding C and use all tools you can to make your life easier and the probability higher for creating better software. Use sanetizers, follow coding standards, use static analysis tools.