samdeepthink
Author

samdeepthink

Knowledge Planet: Old Dock's Tech Chronicles Zhihu: SamDeepThinking A technical manager who still codes heavily on the front line. From junior developer to tech lead, then tech manager, now leading the whole front‑ and back‑end development team—leveling up along the way. I have some insights on programming, career development, and tech management.

184
Articles
0
Likes
588
Views
0
Comments
Recent Articles

Latest from samdeepthink

100 recent articles max
samdeepthink
samdeepthink
Sep 21, 2026 · Fundamentals

Java final Visibility: JMM Freeze, This Escape, and Lock-Free Guarantees

This article explains how Java's final keyword ensures cross-thread visibility of final fields through the JMM's freeze action at constructor end, provided the this reference does not escape during construction, demonstrating with a code example that shows a race condition when this escapes and the correct behavior when final fields are properly frozen.

JMMJavaJava Memory Model
0 likes · 7 min read
Java final Visibility: JMM Freeze, This Escape, and Lock-Free Guarantees
samdeepthink
samdeepthink
Sep 20, 2026 · Fundamentals

Thread Safety Explained: Why count++ Fails in Multi-threaded Java

This article introduces thread safety by explaining threads, shared memory, and thread switching, then demonstrates a race condition where a Java counter loses increments due to non-atomic count++, and shows how synchronized fixes it by serializing access.

Java ConcurrencySynchronizedatomicity
0 likes · 11 min read
Thread Safety Explained: Why count++ Fails in Multi-threaded Java
samdeepthink
samdeepthink
Sep 16, 2026 · Fundamentals

Java Happens-Before: Visibility Guarantees Beyond Temporal Order

This article demystifies Java's happens-before rules, showing why temporal order doesn't guarantee visibility, and how volatile combined with program order ensures a non-volatile variable's visibility across threads through a concrete code example.

Happens-BeforeJMMJava
0 likes · 13 min read
Java Happens-Before: Visibility Guarantees Beyond Temporal Order
samdeepthink
samdeepthink
Sep 15, 2026 · Backend Development

Java 17 Memory Barriers: Why They're Needed and How to Use Them

This article explains Java memory barriers using a simple two-thread example, detailing how compiler reordering, CPU out-of-order execution, and cache inconsistency cause visibility issues, and shows how volatile and VarHandle provide acquire/release semantics to guarantee correct ordering in Java 17.

CPU reorderingJMMJava 17
0 likes · 9 min read
Java 17 Memory Barriers: Why They're Needed and How to Use Them
samdeepthink
samdeepthink
Sep 10, 2026 · Industry Insights

Good Code Doesn't Equal Good Technical Taste: Mastering Contextual Trade-offs

The article argues technical taste differs from coding ability; it's about making appropriate trade-offs for specific project contexts rather than applying best practices blindly, illustrated by examples like over-engineering a small internal tool with microservices or over-designing urgent projects. Good taste comes from extensive project experience and amplifies effectiveness in the AI era.

AI Eraover-engineeringproject experience
0 likes · 3 min read
Good Code Doesn't Equal Good Technical Taste: Mastering Contextual Trade-offs
samdeepthink
samdeepthink
Sep 9, 2026 · Backend Development

Separation of Concerns: Decoupling SDK Details from Business Logic

The article illustrates Separation of Concerns beyond AOP by refactoring a reconciliation service that mixes WeChat Pay and Alipay SDK calls with business logic, introducing a wrapper layer with custom types to isolate SDK-specific parsing from core matching rules, enabling independent evolution of each concern.

JavaReconciliation ServiceSDK Integration
0 likes · 7 min read
Separation of Concerns: Decoupling SDK Details from Business Logic
samdeepthink
samdeepthink
Sep 8, 2026 · Fundamentals

Why If Nesting Beyond 3 Levels Hides Bugs: Flatten with Guard Clauses

The article demonstrates how deep if nesting (over 3 levels) obscures bugs using a payment callback example where error messages are swapped, then refactors with guard clauses to flatten logic; it also addresses loop nesting by extracting methods to reduce cognitive load, emphasizing keeping conditions close to their handling.

bug preventionclean codecode nesting
0 likes · 10 min read
Why If Nesting Beyond 3 Levels Hides Bugs: Flatten with Guard Clauses