Depth Over Fluency

Engineering When the
Agent Writes the Code

Depth Over Fluency · Renato G. Cavalcanti

Renato Guerra Cavalcanti

  • Most of my career on the JVM: Java and Scala
  • BeScala: the Belgian Scala User Group
  • Event Sourcing, CQRS, Microservices
  • Play/Lagom, Akka Core, Akka Runtime/SDK

Like most of you,
I have a coding agent writing my code.

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 programming 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, reasoning, freedom, flexibility
  • We are shaped by it:
    practice, tears and sometimes blood
  • The code we write with our hands are 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
Java 45%Scala 20%Kotlin30%
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 based on
    its training data and your codebase
  • 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

Average software

Depth Over Fluency · Renato G. Cavalcanti

Average software

  • All content the labs can get their hands on
  • The great blogs about software engineering
  • Well-crafted OSS code from many great projects
  • And all the slop and garbage out there
Depth Over Fluency · Renato G. Cavalcanti

Average by default

  • Without guidance, the model drifts to the centre
  • It can produce good code
  • But on average...
    • you get average code

Your knowledge creates the anchors.

Depth Over Fluency · Renato G. Cavalcanti

The provider's incentives

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

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

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
  • Exhaustive tests, all green, but not battle tested
  • Apache Commons Compress has done this for years

Knowing what already exists
and making a judgment call 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 true
  • 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...

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

Hypes and vibes

Depth Over Fluency · Renato G. Cavalcanti

Hypes and vibes

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

But let's not forget software engineering

Depth Over Fluency · Renato G. Cavalcanti

Automation paradox

Depth Over Fluency · Renato G. Cavalcanti

Automation paradox

  • Also known as the Bainbridge Paradox
  • Lisanne Bainbridge, cognitive scientist
  • Ironies of Automation (paper from 1983)
  • Becoming surprisingly popular among software engineers
Depth Over Fluency · Renato G. Cavalcanti

Automation paradox

Bainbridge argues that new, severe problems are caused by automating most of the work, while the human operator is responsible for tasks that cannot be automated.

Thus, operators will not practice skills as part of their ongoing work.

Their work now also includes exhausting monitoring tasks.

Wikipedia, Ironies of Automation

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

Depth over fluency

Depth Over Fluency · Renato G. Cavalcanti

Depth over fluency

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

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

Depth Over Fluency · Renato G. Cavalcanti

Owning the code you didn't type

Depth Over Fluency · Renato G. Cavalcanti

Thank you!

Depth Over Fluency · Renato G. Cavalcanti