Owning the code
you didn't type

Owning the Code You Didn't Type · Renato G. Cavalcanti

Renato Guerra Cavalcanti

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

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

Owning the Code You Didn't Type · Renato G. Cavalcanti

Depth over fluency

Owning the Code You Didn't Type · Renato G. Cavalcanti

What does it mean to write code?

  • It's a cognitive process
  • We think: the problem, the constraints, the requirements
  • We translate our thoughts into a
    programming language

That's our engineering practice
and it's very enjoyable.

Owning the Code You Didn't Type · Renato G. Cavalcanti

It is also about identity

  • It reveals who we are:
    guarantees, reasoning, freedom
  • We shape the code with our own hands
  • We hang out with other developers
  • We share ideas and stories

Our coding practice shapes who we are.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Fluency vs. Depth

  • Fluency
    syntax, idioms, the standard library by heart
  • Depth
    the runtime, memory, concurrency,
    design principles, engineering judgment

Fluency just became borrowable.
Depth is on you. It's your judgement call.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Where is the bug, if any?

Scala for-comprehension

for {
 _ <- applyGuardrails(..) // returns Scala Future
 _ <- runInterceptors()
} yield Done

This thing claimed that if applyGuardrails() failed, runInterceptors() would silently recover the failure.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Where is the bug, if any?

Desugared

applyGuardrails(..) // returns Scala Future
  .flatMap(_ => runInterceptors())
  .map(_ => Done)

This thing claimed that if applyGuardrails() failed, runInterceptors() would silently recover the failure.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Where is the bug, if any?

Java CompletionStage

applyGuardrails(..) // returns CompletionStage
  .thenCompose(it -> runInterceptors())
  .thenApply(it -> Done.getInstance());

This thing claimed that if applyGuardrails() failed, runInterceptors() would silently recover the failure.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Memory management

Owning the Code You Didn't Type · Renato G. Cavalcanti

We learn while we code

  • A clear idea is a luxury
  • Doubts, changes of direction, experimentations
  • We touch the code, we learn. We change it, we learn.

Typing is not what takes time.
It's the understanding.

Owning the Code You Didn't Type · Renato G. Cavalcanti

We learn while we code

  • We build a mental model
    while we write the code
  • While doing that, we train our own brain
  • Someone else's code: a gap between our mental model and the code
Owning the Code You Didn't Type · Renato G. Cavalcanti

Boring tasks

  • Sometimes we know exactly what to write
  • Nothing to learn, nothing to discover
  • Just mechanical typing

Delegate it. It costs us nothing.

Owning the Code You Didn't Type · Renato G. Cavalcanti

But don't delegate everything

  • The tasks where we used to
    think, experiment and learn
  • Otherwise, your application slowly
    becomes someone else's application

You end up approving changes
you don't understand.

Owning the Code You Didn't Type · Renato G. Cavalcanti

LGTM

Looks GoodGreen To Me

Owning the Code You Didn't Type · Renato G. Cavalcanti

Average software

Owning the Code You Didn't Type · Renato G. Cavalcanti

Trained on everything

  • 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
Owning the Code You Didn't Type · 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.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Your knowledge is what
pulls the model
away from the center

Charafeddine Mouzouni
How to Think With AI

Owning the Code You Didn't Type · 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
Owning the Code You Didn't Type · Renato G. Cavalcanti

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

Owning the Code You Didn't Type · Renato G. Cavalcanti

Learn and Steer

Owning the Code You Didn't Type · Renato G. Cavalcanti

Learn and Steer

  • Learn
    the typing used to teach us, now it doesn't
  • Steer
    pull the model away from the average

We need other ways to stay sharp.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Made for humans

  • All text must be understandable
  • Applies to docs, code comments and chat replies
  • But also code design
  • Today's code is the context for tomorrow's code
Owning the Code You Didn't Type · Renato G. Cavalcanti

Pointing back

There are two configs in play. The one the test loads isn't the one the fix touched, so the other one still wins.

The test loads test.conf, but the fix changed application.conf. The test still sees the old value.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Verbs as nouns

The capture writes as the service account, and the read resolves against the same.

The capture service writes artifacts with the service account identity. The reader fetches them with the same identity.

Owning the Code You Didn't Type · Renato G. Cavalcanti

My writing rules

## How to write

Write plainly. Write for clarity, not for style.

- Please remove all mannered prose.
- One idea per sentence. Aim for under 20 words.
- Use active voice. Name who does what.
- Use one term per concept. Never vary wording for style.
- Prefer the short common word over the long one.
- No noun stacks longer than three words.
- Cut filler: "essentially", "it's worth noting", "in order to".
Owning the Code You Didn't Type · Renato G. Cavalcanti

A reminder on every prompt

  • CLAUDE.md loads once.
    In a long session, the style drifts.
  • A hook adds one line to every prompt:
{
  "hookSpecificOutput": {
    "hookEventName": "UserPromptSubmit",
    "additionalContext": "Write replies per the \"How to write\" rules in ~/.claude/CLAUDE.md."
  }
}
Owning the Code You Didn't Type · Renato G. Cavalcanti

Prompt is a terrible medium

  • It scrolls away. You cannot jump around or annotate it.
  • Specs, plans, summaries, walk-throughs: files
  • Write files in .nogit/
    (excluded in my .gitignore_global)

I review in files, not in the chat.

Owning the Code You Didn't Type · Renato G. Cavalcanti

/check-inbox

While coding, I leave you messages in the source as comments
tagged TODO-AI or QUESTION-AI.

- TODO-AI: something I want you to implement or change.
- QUESTION-AI: something I want you to explain.

Never remove a tag before I've approved that message.
Never batch-apply: one message, one approval.
Owning the Code You Didn't Type · Renato G. Cavalcanti

/walk-through and /walk-replay

  • For code reviews, and for code I don't know
  • A reading order, not a raw diff
  • It runs in parallel while I do something else
  • Steps written to .nogit/
Owning the Code You Didn't Type · Renato G. Cavalcanti

/walk-through and /walk-replay

/walk-through 238n6q6us                 # from this commit to HEAD
/walk-through 4582                      # a pull request
/walk-through explain the http client retry mechanism
/walk-through -i ...                    # interactive, step by step

/walk-replay pr-4582                    # one step at a time
  • I replay them, ask questions, and say "go ahead"
Owning the Code You Didn't Type · Renato G. Cavalcanti
Owning the Code You Didn't Type · Renato G. Cavalcanti

Phased delivery

  • One phase at a time, then stop
  • Review, touch the code, commit
  • Pair programming. Some phases are mine
  • Sometimes I call /autonomously
    • assistant should finish all phases
    • but commit per phase
  • I review the commits individually
Owning the Code You Didn't Type · Renato G. Cavalcanti
Owning the Code You Didn't Type · Renato G. Cavalcanti

Knowledge workers

Owning the Code You Didn't Type · Renato G. Cavalcanti

Faster, but at what cost?

  • AI already empowers us enormously
  • The migration you kept postponing
  • The flaky build, the experiment, the brainstorm
  • Don't let the hype set your pace

Go fast when you can, slow down to build knowledge.

Owning the Code You Didn't Type · Renato G. Cavalcanti

Don't outsource your brain

  • You and your team should own the code
  • Accountability is not being removed
  • You are the stewards of its quality
  • Invest in your knowledge
  • Learn how to guide the agents and train your brain
Owning the Code You Didn't Type · Renato G. Cavalcanti

Upcoming talks

Depth Over Fluency

Wednesday, Oct 21
jDD - Kraków

Kill -9 and Carry On

Wednesday, Oct 28
AxonIQ Conference - Utrecht

Owning the Code You Didn't Type · Renato G. Cavalcanti

On GitHub

I also use, and recommend:

  • /pr-review-toolkit
  • /superpowers

octo-stack is my personal setup. Experiment with it and take inspiration. It can change at any moment.

Owning the Code You Didn't Type · Renato G. Cavalcanti

This deck

Rate this talk

Owning the Code You Didn't Type · Renato G. Cavalcanti

Thank you!

Owning the Code You Didn't Type · Renato G. Cavalcanti