Effective Java (3rd ed.)

Effective Java — Joshua Bloch, Pearson Addison-Wesley 2018 (3rd ed.), ISBN 978-0-13-468599-1 This is not just the best book on Java, but one of the best I’ve read on any programming subject. Every Java developer will benefit from Bloch’s solid advice and thorough exploration of language and library quirks, on a par with classic namesake … Continue reading “Effective Java (3rd ed.)”

Programming Languages in 2017

Time for the annual collection of programming language news. Little has changed in terms of popularity rankings; the usual suspects dominate. JavaScript maintains its overall lead, except in the bizarro world of TIOBE. Established newcomers Go, TypeScript, and Swift continue making inroads but are still relatively niche. Kotlin (on which more below) might have a … Continue reading “Programming Languages in 2017”

Core Java 9 for the Impatient

Core Java SE 9 for the Impatient — Cay S. Horstmann, Pearson Addison-Wesley 2017 (2nd ed.), ISBN 978-0-13-469472-6 The Impatient series condenses the traditional monumental Core Java tomes (2,072 pages for Java SE 8) into a single book a quarter the size – 538 pages for Java SE 9, 480 pages for the first edition … Continue reading “Core Java 9 for the Impatient”

Java SE 9 First Look

Oracle has finally released Java SE 9, now available on the Oracle Technology Network. As usual the official end-user portal java.com will switch versions later, so for now it still distributes Java SE 8u144. I have yet to install the JDK, as the corresponding NetBeans update was delayed by its transition from Oracle to Apache. … Continue reading “Java SE 9 First Look”

Java Performance Notes

There have been several remarkable articles on Java performance issues in the last couple of months. Those links tend to get lost on Twitter, so I wanted to compile them here with brief overviews. All articles are based on the OpenJDK which also underlies Oracle’s distributions. Java and SIMD Piotr Nowojski tests automatic loop vectorization, … Continue reading “Java Performance Notes”

Catching Java Assertion Errors

The Java assert statement can be used for conditionally checking program invariants. Assertions are enabled or disabled with the desired level of granularity by Java Virtual Machine flags, as described in the linked guide. So far, so similar to assertion facilities in other languages. However, whereas .NET Debug/Trace.Assert shows and logs a message by default, … Continue reading “Catching Java Assertion Errors”

JavaFX Chart Coloring

Working on a Java(FX) port of my hoplite simulator Myriarch, I ran into an unexpected problem with the history chart. This part of the “Simulation Report” dialog shows how each faction’s unit count changes over the course of the simulation. You can see a screenshot from the current build below. The control is a standard … Continue reading “JavaFX Chart Coloring”

Compiling Java Code

This post is a quick introduction aimed at programmers experienced with C# or other languages who are new to Java. It is intended as a companion piece to my article Java for C# Programmers which focuses on language differences. See the “Further Reading” section at the top of that article for the official Oracle tutorials … Continue reading “Compiling Java Code”

JavaFX Snapshot Scaling

If you try taking image snapshots of a JavaFX Node on a high-DPI system, you’ll find that the result is strangely blurry. This is an unfortunate side effect of the JavaFX DPI scaling introduced in Java SE 8u60. At resolutions greater than 120 DPI, JavaFX automatically treats all coordinates as abstract “layout pixels” with a … Continue reading “JavaFX Snapshot Scaling”

Programming Languages in 2016

According to two out of three major language surveys I consulted for 2016, programming is increasingly becoming synonymous with web development in JavaScript. No doubt this reflects, on the developer side, the rapid march towards web services and HTML applications everywhere in computing. Other than JavaScript and HTML itself, though, a stable comprehensive application framework … Continue reading “Programming Languages in 2016”