Module 1: C Programming Fundamentals: Mistake Clinic
This clinic turns wrong moves into reusable judgment. Use it after each practice page and again before the quiz or checkpoint.
Module-Specific Mistake Radar
Start with these traps. Replace or extend them with real mistakes from your own work.
| Mistake to look for | Where it shows up | Symptom | Repair evidence |
|---|---|---|---|
| Finishing C Compilation and Mental Model Lab with only a final answer | C Compilation and Mental Model Lab | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Types, Control Flow, and Functions Workshop with only a final answer | Types, Control Flow, and Functions Workshop | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Arrays, Strings, and I/O Clinic with only a final answer | Arrays, Strings, and I/O Clinic | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Finishing Code Katas with only a final answer | Code Katas | The work has no failed case, trace, test, proof gap, or design stress point. | Add the smallest broken example and show the repair that changes the result. |
| Treating C Is a Portable Assembler as vocabulary instead of a tool | C Is a Portable Assembler | The explanation names the concept but cannot decide between two cases. | Write one example, one non-example, and the rule that separates them. |
| Treating The Translation Pipeline as vocabulary instead of a tool | The Translation Pipeline | The explanation names the concept but cannot decide between two cases. | Write one example, one non-example, and the rule that separates them. |
Practice Mistake Checks
Pull any miss from these checks into your mistake log.
C Compilation and Mental Model Lab
Source: practice/01-c-compilation-and-mental-model-lab.md
For each statement, identify the error:
- "The preprocessor imports headers like Python imports modules."
- "If the program runs fine in debug mode, there is no undefined behavior."
- "The compiler reports every undefined reference it detects."
- "
gcc -std=c89means the compiler targets only 32-bit processors." - "A translation unit is the same thing as an executable."
Types, Control Flow, and Functions Workshop
Source: practice/02-types-control-flow-and-functions-workshop.md
For each, identify the error:
if (x = 5) { ... }#define SQUARE(x) x*xprintf("%d\n", sizeof(int));int arr[10]; void f(int arr[10]) { size_t n = sizeof arr / sizeof arr[0]; ... }register int *p = &x;for (unsigned i = n; i >= 0; i--) { ... }int *arr = (int*)malloc(sizeof(int)); for (i = 0; i < 10; i++) arr[i] = i;#define MAX 100;used asfor (int i = 0; i < MAX; i++)
Arrays, Strings, and I/O Clinic
Source: practice/03-arrays-strings-and-io-clinic.md
For each, identify the error:
char name[8]; strcpy(name, "Kernighan");char *s = "hi"; s[0] = 'H';char buf[100]; sprintf(buf, "%s %s", a, b);whereaandbare user inputchar buf[100]; fgets(buf, 100, stdin); buf[strlen(buf)-1] = '\0';int n; scanf("%d", n);printf(user_input);char dst[5]; strncpy(dst, "hello world", 5);thenputs(dst);void f(int a[10]) { size_t n = sizeof a / sizeof a[0]; /* loop over n */ }
Repair Protocol
For each real mistake:
- Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
- Name the hidden assumption.
- Repair the artifact.
- Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
- Add one retrieval card beginning with Check... before... or Do not use... when....
Mistake Log
| Date | Mistake | Symptom | Root cause | Repair evidence | Retrieval card |
|---|---|---|---|---|---|
| Starter | Pick one radar row above | Explain how it would fail in this module | Name the assumption | Add a counterexample or corrected artifact | Write the card before closing the page |
Completion Standard
- At least five real mistakes are logged.
- At least two mistakes include a counterexample or failing test.
- At least one mistake connects to an older semester skill.
- At least one correction changes code, a proof, a diagram, a command transcript, a query, or a design decision.