Java Foundations: the primitives, runnable
Reference articles for the Java primitives, each explained and backed by a runnable brick: data modeling, then the memory model.
Field guide2 articles20 min read
These are the reference articles for the Java primitives. Every article pairs with one runnable brick in the java-foundations repo, and one command runs it. Where an article measures something, the number comes from that brick's recorded runs, with the machine named.
The list below is in publication order, and it's the only order there is. Each article carries one rule you can keep in your head, and the key ideas under the list collect them, one per article. More parts join as the bricks get written up.
In this guide
Records, sealed interfaces, and exhaustive switch: one modeling primitiveRecords, sealed interfaces, and pattern matching are usually taught as three Java features. Together they form one modeling primitive that turns a fail-open security bug into a compile error.9 min read
Java memory model: volatile, atomic, synchronized and final, measuredvolatile makes each read and each write visible, but it does not make hits++ one step. Three runnable JDK 27 experiments measure what volatile, AtomicInteger, synchronized and final each promise.11 min read
Key ideas
- Next time you reach for a record, ask whether it's actually one alternative of a closed set. If it is, seal the set and delete the default branch.
- One writer:
volatile. New value from the old one: atomic. More than one line:synchronized.
More guides
- Building ralphctl: an agent harness, release by releaseThe build log of one agent harness: how ralphctl went from a v0.0.4 sprint CLI to a cross-provider loop I trust to run coding agents overnight.5 articles 70 min read
- Spring Boot and Postgres: where the limits actually areOne Spring Boot app, one Postgres: where a request really queues, what the connection pool gates, and how much search the database can do on its own.2 articles 46 min read
- Spring Boot and OAuth2: a field guide for every surfaceSecure a Spring Boot app with OAuth2 across every surface: HTTP APIs, the gateway, and the message broker, all on one Keycloak and the same scopes.5 articles 102 min read
- AI agent harnesses: a field guideWhat an AI agent harness is, how the generator-evaluator loop and check gates decide when a change is done, and why the harness is the part you trust.3 articles 35 min read