Context
With Next.js selected as our frontend framework, we need to decide between JavaScript and TypeScript. Both are fully supported by Next.js.
Options Considered
| Option | Pros | Cons | Fit |
|---|---|---|---|
| [[typescript]] | Catches bugs before runtime, powerful autocomplete, industry standard, types serve as documentation | Learning curve, compile step, config file needed | ✅ |
| JavaScript | No setup, shorter code, zero learning curve | Runtime bugs, weak autocomplete, falling behind in industry adoption | ❌ |
Decision
TypeScript.
Primary reasons:
- Industry standard — ~78% of JS developers use TypeScript (2025). Job postings list TypeScript, not JavaScript. For a portfolio targeting North American jobs, this matters.
- Next.js defaults to it —
create-next-appsets up TypeScript automatically. No extra configuration burden. - Gradual adoption — We can start writing JavaScript-style code in .tsx files and add types progressively. No need to learn advanced TypeScript upfront.
- Portfolio signal — TypeScript in a portfolio project demonstrates awareness of production-grade practices.
- Editor experience — Autocomplete and inline documentation make working with unfamiliar libraries much faster.
Consequences
- Learning overhead — TypeScript adds concepts (interfaces, generics, type narrowing) on top of JavaScript. Mitigated by starting with basic types and learning as needed.
- Occasional type fights — Some third-party libraries have poor type definitions, requiring
anyescape hatches. Acceptable for a portfolio project.