Topics

Kotlin for Java developers

Kotlin vs Java for backend developers: what Kotlin still does better than Java 25 in Spring Boot, data classes vs records, and the features worth knowing.

9 posts · newest November 29, 2026

Start with

  1. Kotlin vs Java for Backend Development in 2026

    Kotlin vs Java for backend development in 2026: what Kotlin still does better, what modern Java caught up on, where Java wins, and how to choose.

  2. Kotlin Data Classes vs Java Records vs Lombok Builders

    Kotlin data classes, Java records and Lombok's @Value and @Builder compared: what each generates, the traps, interop, and which to use in your codebase.

For a new Spring Boot service I’d pick Kotlin. For a team whose code and hiring are all Java, Java can still be the right call. Both run on the same JVM with the same libraries, so you’re choosing a language, not an ecosystem.

Should you switch? Link to heading

Start with Kotlin vs Java for Backend Development in 2026. It weighs both languages against Java 25 and Spring Boot 4: what Kotlin still does better, what records, sealed types and virtual threads have caught up on, and where Java is the better choice.

The earlier posts make the one-sided case. Why Kotlin? is why I moved after years of Java, and Why Kotlin Beats Java for Backend Development is the 2025 argument for the backend specifically.

Modelling data Link to heading

Most backend code moves data around, so data classes are where Kotlin pays off first. Kotlin Data Classes vs Java Records vs Lombok Builders shows the same class written three ways and says which to use in which codebase, including types both languages share. Why Kotlin Data Classes Shine goes deeper on immutability, copy() and converters, and why entity classes need care.

Features worth knowing Link to heading

  • Scope functions: when to use apply, let, also and run.
  • Sequences: when they beat collections, when they’re slower, and Sequence vs Flow.
  • Context parameters in Spring: stable since Kotlin 2.4, and a clean way to carry per-request context.
  • Writing a Kotlin DSL: when one is worth writing (less often than you’d think), and one state machine built in Java, in Kotlin and as a DSL.

For moving an existing service to a new Kotlin or Spring Boot version, see Kotlin and Spring Boot upgrades.

All posts in this topic

  • Kotlin Data Classes vs Java Records vs Lombok Builders

    Three ways to write a value type on the JVM. Here’s the same class written all three ways, what each one generates, where Lombok still earns its place next to records, the traps they share, how they work across Kotlin and Java, and which to pick.

  • Kotlin vs Java for Backend Development in 2026

    Records, pattern matching and virtual threads have closed part of the gap. Here’s what Kotlin still does better for Spring Boot services, where Java is the better choice, and how I’d decide for a new service or an existing team.

  • Writing a Kotlin DSL: One State Machine in Java, Kotlin and a DSL

    A DSL earns its keep when the thing you’re building contains itself. This post builds a nested subscription lifecycle by hand in Java and in Kotlin, then with a Kotlin DSL, and walks through every line of the DSL, including the bug @DslMarker exists to stop.

  • Kotlin Context Parameters in Spring: A Practical Guide

    Kotlin 2.4.0 made context parameters stable. Here’s how I’d use them in a Spring service to carry one per-request snapshot through the call chain — and where constructor injection is still the right tool.

  • Safer, Simpler, Stronger: Why Kotlin Data Classes Shine

    Kotlin data classes aren’t just about cutting boilerplate — they help you write safer, more reliable, and easier-to-maintain backend code. Here’s how to use them wisely.

  • Kotlin Sequences: When to Use Them, and Sequence vs Flow

    Kotlin Sequences offer lazy evaluation and powerful chaining, but they aren’t always the fastest choice. Learn when they provide real benefits—and when you’re better off with regular collections.

  • Kotlin: When to use apply, let, also, and run

    Kotlin’s scope functions — apply, let, also, and run — can be confusing but are powerful tools for writing expressive and clean code. This post explains what they are, how they differ, and when to use each one effectively.

  • Why Kotlin Beats Java for Backend Development

    Kotlin isn’t just easier to write than Java — it’s better suited for building backend systems. With features like nullable parameters, data classes, cleaner dependency injection, and Spring support, Kotlin reduces boilerplate and enhances developer productivity in real-world backend services.

  • Why Kotlin?

    Kotlin is a modern programming language that improves on Java’s verbosity, offering a cleaner, more expressive syntax with strong null safety, type inference, and better defaults. This post shares why I chose to adopt Kotlin after years of professional Java development.