|
|
|
|
|
by mechanical_fish
5273 days ago
|
|
This chapter is explicitly teaching people what the author's idea of bad C code is: It has them read some, then tells them specifically what the gotchas are, then asks them to code up test cases for the flaws and run them through Valgrind. Where's the "avoiding" here? And which of the skills being exercised - imagining what kinds of bad things could happen, writing executable test cases, detecting segfaults - are not useful in the real world? |
|
Using K&R to do this is to give people a set of known good C code samples and show how even those can be broken and misused.