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 7, 2026 · Fundamentals

Boost Readability by Reordering Code Lines — Data-Flow Order Beats Method Extraction

The article shows how interleaving multiple data-flow chains in a method forces readers to context-switch, and demonstrates that simply reordering lines to follow each chain sequentially — without changing logic or extracting methods — dramatically improves readability, while explaining why method extraction can backfire when variables are shared across chains.

Code Readabilityclean codecode organization
0 likes · 8 min read
Boost Readability by Reordering Code Lines — Data-Flow Order Beats Method Extraction
samdeepthink
samdeepthink
Sep 6, 2026 · Backend Development

Functional Core, Imperative Shell: Refactoring Checkout Code for Testability and Reuse

The article demonstrates refactoring a tangled checkout method by separating pure calculation logic into a functional core using Java 17 records and sealed interfaces, leaving IO operations in an imperative shell, resulting in easily testable, reusable code without mocks or Spring containers.

Functional Core Imperative ShellJava 17Unit Testing
0 likes · 10 min read
Functional Core, Imperative Shell: Refactoring Checkout Code for Testability and Reuse
samdeepthink
samdeepthink
Sep 4, 2026 · Backend Development

HashMap Grouping: From Three Lookups to One computeIfAbsent Call

This article explains how Java 8's computeIfAbsent reduces HashMap grouping from three separate lookups (containsKey, put, get) to a single atomic operation, covering lazy evaluation, concurrency safeguards, null handling, nested grouping patterns, and when to prefer computeIfAbsent over Collectors.groupingBy for streaming data.

HashMapJava 8Map methods
0 likes · 7 min read
HashMap Grouping: From Three Lookups to One computeIfAbsent Call
samdeepthink
samdeepthink
Sep 3, 2026 · R&D Management

AI-Generated Code Quality Control: A Spec-Driven Workflow with Automated Skills

The author shares a 15-step AI-assisted workflow for code quality control, starting with spec-driven development, automated skills for code review, regression checks, test data rehearsal, non-functional requirements validation, mandatory manual review, and optional security/extensibility checks, all orchestrated via AI-written skills and git integration.

AI-Assisted DevelopmentGit workflowRegression Testing
0 likes · 6 min read
AI-Generated Code Quality Control: A Spec-Driven Workflow with Automated Skills
samdeepthink
samdeepthink
Sep 2, 2026 · R&D Management

First Step for a New Architect: Join Development and Build Small Modules

The author argues that a newly hired architect should begin by actively coding small components, then medium and large ones, because hands‑on experience reveals system details and consistency challenges that pure business or team briefings cannot provide.

R&D managementhands-on developmentnew architect
0 likes · 3 min read
First Step for a New Architect: Join Development and Build Small Modules
samdeepthink
samdeepthink
Sep 1, 2026 · Fundamentals

Why Java Static Blocks Aren’t Executed First

The article explains that Java static blocks are not always the first code to run during class loading because static field initializers and static blocks are executed in the order they appear in the source, and a static field can trigger instance initialization.

Class LoadingJavaJava fundamentals
0 likes · 6 min read
Why Java Static Blocks Aren’t Executed First
samdeepthink
samdeepthink
Aug 31, 2026 · Fundamentals

Why Java Arrays Have No Constructors and How the JVM Instantiates Them

The article explains that Java arrays, unlike regular objects, lack constructors because the JVM creates them directly via special bytecode instructions, automatically zero‑initialising elements and exposing length as a field, which trades flexibility for simplicity and performance.

JVMJavaarrays
0 likes · 6 min read
Why Java Arrays Have No Constructors and How the JVM Instantiates Them
samdeepthink
samdeepthink
Aug 30, 2026 · Fundamentals

Understanding the Open‑Closed Principle Through Spring’s Extension Hooks

The article explains the Open‑Closed Principle, shows how Spring leaves empty hook methods like onRefresh() for extensions, demonstrates the concept with a Java demo, compares inheritance‑based and interface‑based extension approaches, and discusses trade‑offs and practical guidelines for designing extension points.

Design PatternsExtension HooksJava
0 likes · 10 min read
Understanding the Open‑Closed Principle Through Spring’s Extension Hooks
samdeepthink
samdeepthink
Aug 29, 2026 · Fundamentals

Why a Contract‑Compliant List Still Breaks Liskov Substitution in Java

The article demonstrates that although List.of, Arrays.asList, and unmodifiableList implement the List interface, they violate the Liskov Substitution Principle because their optional add/remove operations throw UnsupportedOperationException, revealing a hidden contract mismatch between interface documentation and runtime behavior.

Design PrinciplesImmutable CollectionsJava
0 likes · 13 min read
Why a Contract‑Compliant List Still Breaks Liskov Substitution in Java
samdeepthink
samdeepthink
Aug 28, 2026 · Fundamentals

How Java’s LocalDate Embodies the Single Responsibility Principle

The article explains how JDK 17’s java.time.LocalDate follows the Single Responsibility Principle by separating date data from formatting, contrasts this design with the older mutable java.util.Date, and shows how to spot classes that take on too many responsibilities.

API designDateTimeFormatterImmutable Objects
0 likes · 6 min read
How Java’s LocalDate Embodies the Single Responsibility Principle