java

Difference between .equals and == in Java

Java was first releases in 1996. After almost 30 years and more than 20 successive iterations of the language, it comes to no surprise that it has a few dusty corners and surprising quirks. One of them is the difference between == and .equals. If you come from more modern languages, such as Go, you might expect that new MyClass("a") == new MyClass("a")… but it is not the case! Reference equals (==) In Java == operates on references.
Read more

Speeding Up a Java CLI Part One: AppCDS

During my free time, I am developing javaimports , a goimports-like Java command line tool that auto-imports Java classes without relying on an IDE, a LSP or any kind of cache. I use it daily to write Java, pairing it with google-java-format to automatically format my code and add missing imports on save. Obviously, I need javaimports to run fast, which pushes me to look for ways to make my code, and Java command line applications in general, faster.
Read more

Introducing an Auto-formatter on a Big Codebase

Over the past few years, auto-formatting utilities (that do code formatting for you) such as gofmt , black or google-java-format have become increasingly popular. While such tools undoubtedly provide some benefits when used from the start of a project, changing the code style of an entire codebase is hard. The larger it is, the harder it is to break through its inertia… Which begs the question: is it worth it?
Read more