Depth Over Fluency

Engineering When the
Agent Writes the Code

Depth Over Fluency · Renato G. Cavalcanti

Renato Guerra Cavalcanti

  • 27 years building software, most of it on the JVM: Java and Scala
  • Founded the Belgian Scala User Group
  • Event Sourcing, CQRS, Microservices
  • Play/Lagom, Akka Core, Akka Runtime/SDK

Rethinking my own work nowadays

Depth Over Fluency · Renato G. Cavalcanti

What I mean by fluency

Depth Over Fluency · Renato G. Cavalcanti

Before the code

Depth Over Fluency · Renato G. Cavalcanti

Before the code

  • Let's do this together: remember how you started
  • A different world: psychology, then philosophy
  • Programming came by chance, not by plan
  • I found something I did not know I was looking for
Depth Over Fluency · Renato G. Cavalcanti

What does it mean
to write code?

Depth Over Fluency · Renato G. Cavalcanti

What does it mean to write code?

  • A language lets us express intention
  • Translate thought into a logical, unambiguous form
  • The zone: immersed in the problem, thinking in code

We enjoy it. We are proud of it.

Depth Over Fluency · Renato G. Cavalcanti

Language is also identity

Depth Over Fluency · Renato G. Cavalcanti

Language is also identity

  • Our favourite language reveals what we value: guarantees, freedom, reasoning
  • We are shaped by it:
    practice, tears and sometimes blood
  • The code we write with it is ours

This is what is being taken away from us

Depth Over Fluency · Renato G. Cavalcanti

Who is typing now?

Depth Over Fluency · Renato G. Cavalcanti

Next token, please

I would like to
eat 23%go 24%code 31%
I would like to code
in 22%a 18%faster 11%
I would like to code in
Kotlin 35%Scala 20%Rust 12%
I would like to code in Scala

Probable, not certain.

Depth Over Fluency · Renato G. Cavalcanti

Code is no different

Depth Over Fluency · Renato G. Cavalcanti

Code is no different

  • For any requirement there are many correct programs
  • The model picks the most probable path: its training data and your repository
  • The harness keeps it on track: compile, test, lint, review, loop

What comes out is still one probable program among many

Depth Over Fluency · Renato G. Cavalcanti

The provider's incentives

  • We pay a subscription, the provider pays for compute
  • The incentive: reach an answer with the least compute, in a reasonable time
  • Less compute means fewer tokens: the first path that works wins

The harness is tuned to stop early

Depth Over Fluency · Renato G. Cavalcanti

What is a reasonable time?

  • It used to be days: analyse, write, test, refine
  • Now we expect minutes
  • From a spec we wrote in a hurry

We ask for fast and quality.
We get fast and Ok'ish.

Depth Over Fluency · Renato G. Cavalcanti

Depth can't be outsourced

Depth Over Fluency · Renato G. Cavalcanti

Why should we care,
if it works?

Depth Over Fluency · Renato G. Cavalcanti

Why should we care, if it works?

  • Correct is not the same as desirable
  • Correct code can still be convoluted or wasteful
  • Read more than written, also by the next session
  • Merged code is context. Sloppy patterns compound

Who in the loop can tell correct from good?

Depth Over Fluency · Renato G. Cavalcanti

Some real world examples

Depth Over Fluency · Renato G. Cavalcanti

There must be a
library for this

Depth Over Fluency · Renato G. Cavalcanti

There must be a library for this

  • The task: compress a folder into a tar.gz file
  • The assistant wrote its own tar and gzip code
  • Apache Commons Compress has done this for years
  • Both compile. Both pass the tests.

Knowing what already exists and making a judgment is part of depth

Depth Over Fluency · Renato G. Cavalcanti

Async by reflex

Depth Over Fluency · Renato G. Cavalcanti

Async by reflex

  • The assistant rewrote an Akka endpoint to return a CompletionStage
  • Its claim: wrapping the blocking call in a CompletableFuture is better
  • Not even needed: Akka SDK endpoints run on virtual threads

Knowing your runtime is part of depth

Depth Over Fluency · Renato G. Cavalcanti

Strings all the way down

Depth Over Fluency · Renato G. Cavalcanti

Strings all the way down

public interface Evaluator {
  String name();
  EvalResult evaluate(Sample sample);
}
  • The name() is used to group results in a report
  • An early decision: the name lives on the instance
Depth Over Fluency · Renato G. Cavalcanti

Strings all the way down

Gate gate = Gate.evaluatorRateAtLeast("no-apology", 0.95);
  • Gate is a factory for lambdas that are applied later
  • Typo: evaluatorRateAtLeast("no-apolgy", 0.95) compiles, runs, applies to nothing

Every step was small and locally correct. The strategy was never questioned.

Depth Over Fluency · Renato G. Cavalcanti

The rethink

@EvalLabel("no-apology")
public record NoApology() implements Evaluator {
  public EvalResult evaluate(Sample sample) { ... }
}

Gate gate = Gate.evaluatorRateAtLeast(NoApology.class, 0.95);
  • The label is a report concern
  • It belongs to the class, not the instance
Depth Over Fluency · Renato G. Cavalcanti

The rethink

@EvalLabel("no-apology")
public record NoApology() implements Evaluator {
  public EvalResult evaluate(Sample sample) { ... }
}

Gate gate = Gate.evaluatorRateAtLeast(NoApology.class, 0.95);
  • Using the class instead of an instance
  • Duplicate labels fail at startup, before any evaluator runs

Questioning a past decision is part of depth

Depth Over Fluency · Renato G. Cavalcanti

But also silly code...

public record Employee(
    String id,
    String name,
    Optional<String> managerId,
    List<String> skills) {

  public static final String UNKNOWN_NAME = "unknown";

  public Employee {
    id = id == null || id.isBlank() ? UUID.randomUUID().toString() : id;

    name = name == null || name.isBlank() ? UNKNOWN_NAME : name.trim();

    managerId = managerId == null ? Optional.empty() : managerId;

    skills = skills == null ? List.of() : List.copyOf(skills);
  }
}
var e = new Employee(null, null, null, null);
Depth Over Fluency · Renato G. Cavalcanti

Invalid input is rejected

public record Employee(
    String id,
    String name,
    Optional<String> managerId,
    List<String> skills) {

  public Employee {
    if (id == null || id.isBlank())
      throw new IllegalArgumentException("id is required");
    if (name == null || name.isBlank())
      throw new IllegalArgumentException("name is required");

    Objects.requireNonNull(managerId, "managerId is required");
    Objects.requireNonNull(skills, "skills are required");
    if (skills.stream().anyMatch(s -> s == null || s.isBlank()))
      throw new IllegalArgumentException("skills must not be blank");
    skills = List.copyOf(skills);
  }

  public Employee(String id, String name) {
    this(id, name, Optional.empty(), List.of());
  }
}
Depth Over Fluency · Renato G. Cavalcanti

Non-idiomatic code

object StringUtils {
    fun mask(s: String, visible: Int = 4, maskChar: Char = '*'): String =
        maskChar.toString()
            .repeat((s.length - visible).coerceAtLeast(0)) +
                s.takeLast(visible)
}
println(StringUtils.mask("4111111111111111"))
// ************1111

This was originally in Scala, I translated it to Kotlin for you

Depth Over Fluency · Renato G. Cavalcanti

Idiomatic code

fun String.mask(visible: Int = 4, maskChar: Char = '*'): String =
    maskChar.toString()
        .repeat((length - visible).coerceAtLeast(0)) +
            takeLast(visible)
println("4111111111111111".mask())
// ************1111
Depth Over Fluency · Renato G. Cavalcanti
Introducing VibeCon, the world's largest vibe coding conference. Register today at http://127.0.0.1:8080/register
Depth Over Fluency · Renato G. Cavalcanti

Hypes and vibes

  • Vibe coding
  • Prompt engineering
  • Context engineering
  • Loop engineering
  • Graph engineering (the last trend)

But let's not forget software engineering

Depth Over Fluency · Renato G. Cavalcanti

Depth over fluency

Depth Over Fluency · Renato G. Cavalcanti

Depth over fluency

  • Fluency is borrowable now. The assistant has it.
  • Depth is not. That is you, the software engineer.
  • The assistant does the typing. The judgment is still yours.

Be the one in the loop who can
tell correct from good

Depth Over Fluency · Renato G. Cavalcanti

Upcoming talks

Owning The Code You Didn't Type

Thursday, Oct 8 - Devoxx Belgium - Antwerp

Kill -9 and Carry On

Wednesday, Oct 29 - AxonIQ Conference - Utrecht

Depth Over Fluency · Renato G. Cavalcanti

Thank you!

Depth Over Fluency · Renato G. Cavalcanti