Skip to content

Commit 2f28a39

Browse files
committed
add type guard example to replace import example in false promises section of ai-makes-your-codebase-dumber post
1 parent 1642e3a commit 2f28a39

File tree

1 file changed

+15
-6
lines changed
  • apps/frontendsupport/blog-posts/2026-01-25-ai-makes-your-codebase-dumber

1 file changed

+15
-6
lines changed

apps/frontendsupport/blog-posts/2026-01-25-ai-makes-your-codebase-dumber/index.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,23 @@ AI will.
5454
5555
AI won't. Generic behavioral instructions compete with training patterns and lose. "Don't rewrite code" is abstract. The model ignores it.
5656

57-
What works: specific pattern-based rules. Not "be careful with imports" but:
57+
What works: specific pattern-based rules. Not "handle errors properly" but:
5858

5959
```tsx
60-
// Bad: imports entire icon library
61-
import { ChevronRight } from "@mui/icons-material";
62-
63-
// Good: direct import
64-
import ChevronRight from "@mui/icons-material/ChevronRight";
60+
// Bad: swallowing errors
61+
try {
62+
await saveUser(data);
63+
} catch {
64+
// silently fails
65+
}
66+
67+
// Good: surface the failure
68+
try {
69+
await saveUser(data);
70+
} catch (error) {
71+
logger.error("Failed to save user", { error, data });
72+
throw error;
73+
}
6574
```
6675

6776
Vercel's [agent-skills](https://github.com/vercel-labs/agent-skills) takes this approach: 57 concrete React patterns the model can match and apply. Pattern instructions align with how the model works. Behavioral instructions fight it.

0 commit comments

Comments
 (0)