DAILY LOOP (30–60 min)
Run this exact sequence:
1. Perception → Fact vs. Story (2 min)
o Fact: “My test fails.”
o Story: “I’m bad at Java.”
Strip the story. Work the fact.
2. Attention → One needle, not the haystack (20–30 min)
o Pick one tiny target: e.g., “practice Stream#collect into map
with merge,” or “write a JUnit test for edge cases.”
o Do a micro-kata: 10–20 lines that exercise just that behavior.
3. Causality → Trace the bug (5–10 min)
o When something breaks, write a 3-step chain:
Cause → Effect → Fix.
o Example: “Concurrent write → race on HashMap → switch to
ConcurrentHashMap or wrap with synchronization.”
4. Identity → Role swap (2 min)
o Ask: “If I was the JVM itself, what would I do here?”
o Or: “If I was a reviewer, what would I reject?”
5. Meaning → Rename the win (2 min)
o “Today’s failure = data about my mental model.”
o Log one lesson in your journal.
6. Action seed (1 min)
o One next step you’ll do tomorrow, e.g., “JMH micro-benchmark
my String concat vs StringBuilder.”
4-WEEK UPGRADE PLAN (radical + practical)
Week 1 — Core Language & Testing
Focus: types, generics, records, exceptions, immutability, unit tests.
Daily drills:
o Write 3 JUnit 5 tests before code (TDD) for a tiny utility (e.g.,
Money, Range, Either).
o Practice generics: implement Box<T>, Pair<L,R>, wildcard
bounds (? extends, ? super).
Reality prompts:
o Assumption: “More code = more progress.” → Invert: “Fewer
lines, clearer intent.”
o Observation: Measure cyclomatic complexity; refactor until
tests read like specs.
Output: A tiny library with tests and README.
Week 2 — Collections, Streams, Functional Style
Focus: List/Map/Set, stream(), collectors, optionals.
Daily drills:
o Transform a CSV (in-memory) → domain objects → aggregate by
key using [Link], mapping, reducing.
o Write the imperative version first, then stream version;
compare readability & perf with JMH (small benchmark).
Reality prompts:
o Contrast: Imperative vs declarative—what errors disappear?
o Value: Prioritize readability over “clever streams.”
Output: Utilities for typical data transforms + micro-bench results
note.
Week 3 — Concurrency & the JVM Mental Model
Focus: threads, executors, CompletableFuture, thread-safety, memory model
(happens-before), profiling.
Daily drills:
o Wrap an I/O task in ExecutorService; add timeout, cancellation,
backoff.
o Chain CompletableFuture with thenApply/thenCompose/anyOf.
o Replace shared HashMap with ConcurrentHashMap + atomic ops;
add tests to catch races.
o Record a Java Flight Recorder (JFR) snapshot on a small workload;
read CPU/alloc hotspots.
Reality prompts:
o Interconnection: Every shared mutable state is a system
coupling—can you remove it?
o Expectation: “Faster” without measurement is fantasy—profile
first.
Output: A small “concurrent fetcher” module + a one-page perf note
(before/after).
Week 4 — Framework Basics & Delivery
Focus: HTTP API, persistence, testing pyramid, quality gates.
Daily drills:
o Build a minimal REST API (any light framework you prefer) with
one resource, validation, and error handling.
o Add persistence (file/embedded DB), repository pattern, and
integration tests.
o Add quality: static analysis (SpotBugs/Checkstyle), 80% line
coverage on core logic (not controllers).
Reality prompts:
o Context: Local success ≠ prod readiness; add logging, config,
and failure paths.
o Choice: What do you not implement to keep the design clean?
Output: Runnable API + tests + CI script (even local) that runs tests &
checks.
“REALITY → JAVA” MAPPING CHEATSHEET
Perception: Read failing test output verbatim before guessing.
Attention: One API or pattern per day (e.g., only [Link]
variations).
Identity: Swap “coder” → “maintainer.” Delete anything future-you
wouldn’t want to touch.
Belief: “Checked exceptions are annoying.” Test the belief—do they
improve recovery clarity here?
Assumption: “Threads will speed it up.” Benchmark; sometimes I/O
bound means no.
Meaning: Rename “bug” → “missing mental model.”
Time: Schedule hard learning in your personal peak-energy window.
Causality: Make post-mortems: Trigger → Fault → Guardrail you add.
Intention: Before coding, write the method’s one-sentence contract.
Context: Library choice depends on constraints (latency, memory,
team skill).
Contrast: Implement two approaches; keep the one with simpler error
paths.
Emotion: Frustration flags unclear model—draw a sequence diagram.
Value: Prefer clarity > micro-perf until profiling says otherwise.
Energy: Stop at “clean commit”; don’t code tired.
Language: Name things so tests read like English.
Pattern: Notice recurring bugs; add a pre-commit checklist.
Choice: Fewer public methods; more explicit contracts.
Expectation: Document expected load; test for it.
Uncertainty: Write boundary tests first (nulls, empties, extremes).
Interconnection: Log correlation IDs; failures ripple.
Observation: Track what you measure (see KPIs below).
KPIs (track weekly)
Green test count (and % of critical paths covered)
Time-to-fix average for bugs you create
Complexity trend (keep methods <10–15 logical branches)
Perf delta from JMH/JFR notes (before/after)
Lead time: idea → working, tested feature
MICRO-PROJECT LADDER (portfolio-friendly)
1. Data Transformer CLI: reads JSON/CSV, outputs aggregated report;
heavy on Streams and tests.
2. Concurrent Fetcher: pulls from 3 mock endpoints with
CompletableFuture, retries, timeouts, metrics.
3. Mini REST Service: CRUD + validation + integration tests + simple
auth; package with a run script.
DAILY PROMPTS (copy into your journal)
Assumption of the day I’ll challenge: __________
One Java needle I’ll thread today: __________
What the JVM would complain about here: __________
One metric I will measure (not guess): __________
Tiny demo I can show by end of day: __________