Practical, step-by-step guides for everyday engineering challenges. Templates, checklists, and real examples you can use today.
A great PR description saves reviewers 30+ minutes per review. It's the difference between "LGTM" rubber-stamps and meaningful code review that catches bugs and improves architecture.
## PR Template โ add to .github/PULL_REQUEST_TEMPLATE.md ## What does this PR do? Adds AI-powered category suggestion to the expense form. When the user types in the Note field, Groq API suggests a category. ## Why is this needed? Closes #147 โ users spend too much time manually selecting categories. AI automates this for 80% of common expenses. ## How was it tested? - [ ] Unit tests for `aiCategorizer.js` (mock Groq API) - [ ] Manual testing: "Bought coffee" โ suggests "Food & Drinks" - [ ] Edge case: API timeout falls back gracefully (no suggestion shown) ## Screenshots | Before | After | |--------|-------| | [img] | [img] | ## Checklist - [ ] Tests pass locally (`npm test`) - [ ] No console.log left in code - [ ] ENV var documented in README
Code review is a skill. Done well, it catches bugs, spreads knowledge, and improves team velocity. Done poorly, it creates gatekeeping, delays, and resentment.
// โ Unhelpful comment // "This is inefficient" // โ Helpful comment // "nit: This filter runs O(nยฒ) because findExpenseById // searches the full array each iteration. Consider // converting expenses to a Map first (O(n)) โ would // help when the list grows to 1000+ items." // Use prefixes to set expectations: // nit: trivial style issue โ author can ignore // question: I'm genuinely curious, not blocking // suggest: good improvement but not required // blocker: must fix before merge
Production bugs are stressful. A systematic approach removes panic and lets you find the root cause in minutes, not hours.
Database migrations are the #1 cause of deployment-related outages. Run them wrong and you lock your tables, corrupt data, or can't roll back. Run them right and they're invisible.
ALTER TABLE users ADD COLUMN phone VARCHAR(20) can lock the entire table for minutes on large tables. Use ADD COLUMN ... DEFAULT NULL โ nullable columns with no default are instantaneous in Postgres.pg_dump to copy production data to staging and test migrations there first.-- โ Dangerous: locks table, can timeout ALTER TABLE expenses ADD COLUMN currency VARCHAR(3) DEFAULT 'USD' NOT NULL; -- โ Safe: three-step migration -- Migration 1: Add nullable column (instant) ALTER TABLE expenses ADD COLUMN currency VARCHAR(3); -- Migration 2: Backfill in batches (non-blocking) UPDATE expenses SET currency = 'USD' WHERE currency IS NULL AND id BETWEEN 1 AND 10000; -- Run in batches, not all at once -- Migration 3: Add NOT NULL constraint after backfill (fast) ALTER TABLE expenses ALTER COLUMN currency SET NOT NULL;