Defines call by value and call by reference from the Dragon Book and Strachey, then compares how Java, Kotlin, JavaScript, C, C++, C#, Python, Go, Rust, and Ada pass arguments to functions.
Continue ReadingCalling a getter/setter data carrier a VO (Value Object) causes confusion. A Value Object is a classification by meaning and value equality, while a DTO is a classification by its role of transferring data. This article walks through both definitions, how Core J2EE Patterns spread the conflation in the Java/J2EE world, and a naming convention that keeps roles visible.
Continue ReadingHow to state thread safety in Javadoc, and how to use annotations, static analysis tools, and ArchUnit tests to keep code that is unsafe under multiple threads from being deployed.
Continue ReadingConnector/J options that matter for batch workloads on MySQL - useServerPrepStmts, cachePrepStmts, rewriteBatchedStatements, result-set streaming with Integer.MIN_VALUE, and server-side cursors with useCursorFetch - with notes on how each interacts with Spring Batch's JdbcCursorItemReader.
Continue ReadingWhat to get right when launching external processes from Java on JDK 25 and Linux 6.x: draining stdout and stderr, closing stdin, timeouts, termination policy, and cleaning up descendants with process groups or cgroups. Compares zt-exec and Apache Commons Exec, and explains the default posix_spawn launch mechanism, the cost of FORK on large heaps, and the removal of VFORK.
Continue ReadingWhy storing 0.1 in a Java double causes a rounding error in the 52-bit IEEE 754 fraction, two failures it caused (NEIS grading and the Patriot missile), and how to choose between BigDecimal, integer minor units, and libraries such as Java Money.
Continue Reading