4 ms·
"The other way of teaching undefined behavior, by looking at its consequences, is something that we should spend a bit of time on, but it requires a different k
by mannykannot 4y ago
"The other way of teaching undefined behavior, by looking at its consequences, is something that we should spend a bit of time on, but it requires a different kind of thinking and we probably won’t expect the majority of students to pick up on all the subtleties — even seasoned professional C programmers are often unaware of these."
I feel that last phrase exemplifies why this should be given quite a lot of attention. It is also the sort of thing that will lead a student to a deeper insight into the language and how it differs from the other procedural languages that they are likely to already be familiar with (the same can be said for memory management, BTW.)
Such a course might be something of a grind, but if so, it would inculcate the right sort of attitude for programming competently in C!
For dessert, take a quick look at some Obfuscated C winners.