6 ms·
> The problem with c is that you must have a comprehensive dictionary in your brain with tons of corner cases to know what is or is not undefined in any given c
by krychu 3y ago
> The problem with c is that you must have a comprehensive dictionary in your brain with tons of corner cases to know what is or is not undefined in any given compiler setting.
The cases of undefined behavior in the C standard are independent of compiler settings or options.
> If C could have a consistent set of rules …
The C language has a well-defined standard, but the presence of undefined behavior is a deliberate aspect of that standard.
- throwawaymaths 3y agoDeliberateness is not the same as consistency. You can have well defined standards, that are wildly inconsistent. For example, in python, in file A: def get(dict, key): return dict[key] In file B: def get(key, dict): return dict[key] Imagine working in this codebase!