Applied AI Engineering
When to Use AI vs Normal Code
Use AI for fuzzy, language-heavy, perceptual, or hard-to-specify work. Use normal code for explicit rules, calculations, invariants, permissions, and anything that must be deterministic.
- Deterministic rules belong in code
- AI helps when rules are hard to write
- Hybrid systems are usually best
- A model call has product costs
- A prototype can hide production pain
| Task | Prefer | Why |
|---|---|---|
| Calculate invoice total | Code | Exact deterministic formula |
| Extract fields from varied invoices | AI + schema validation | Messy input, structured output |
| Check permission | Code | Security invariant |
| Summarize support thread | AI | Language-heavy compression |
| Route ticket by meaning | AI + fallback | Semantic classification |
| Decide whether to delete data | Code + human approval | Irreversible side effect |