website logo

← All articles

From Senior to Lead: What Changed About How I Write Code

Jumping into a lead engineer role brought it's own package of changes, been there and done that.

For the first eight years of my career, my value was measured in output. I was the person who could untangle the gnarliest legacy callback in a Rails app, optimize a memory leak in Sidekiq, or ship a feature over the weekend.

I loved the craft. I took pride in having the most commits, the most complex PRs, and the deepest knowledge of the codebase.

Then I stepped into a Lead role.

The transition from Senior Engineer to Tech Lead is often framed as a promotion, but in practice, it’s a career change. The skills that got me to the table - technical brilliance and raw speed - are not the skills that keep me there.

Here is what changed about how I write code, review code, and measure my success.

1. The Definition of “My Code” Changed

As a Senior, “my code” was what I pushed to a pull requests. As a Lead, “my code” is the entire repository.

I had to confront a harsh reality: I am no longer the most efficient person to write most of the code.

This required a mental shift from ownership to stewardship. I stopped optimizing for the speed of my keystrokes and started optimizing for the velocity of the team. This means writing code that is easier for others to read than it is for me to write.

The Rails specific shift: In the early days, I’d write a 300-line ActiveRecord scope with clever SQL in a Scenic view. Now, I write the “boring” solution. I prefer explicit service objects over clever metaprogramming. Why? Because explicit code is easier to onboard, easier to debug at 10 PM, and easier for a junior dev to modify without breaking production.

When I write code now, my primary question isn’t “Is this elegant?” but “Does this reduce the cognitive load for the next person who has to touch it?”

2. Code Review is My Primary Lever

I used to view code review as a checkpoint before merge. Now, it is the most important technical work I do.

If I write a feature, I impact one feature. If I review a PR and teach a pattern, I impact every feature that developer touches for the next year.

I’ve moved from being a “gatekeeper” to a “multiplier.” I stopped nitpicking syntax (that’s what RuboCop is for) and started focusing on architecture, security, and long-term maintainability.

I now ask questions like:

  • “How does this failure mode look to the user?”
  • “Does this abstraction leak?”
  • “Is this logic testable in isolation?”

By shifting my focus to review, I catch architectural drift before it becomes technical debt. I use my review time to mentor, explaining the why behind a suggestion, rather than just demanding a change. This is how I stay technical without being the bottleneck.

3. Technical Credibility Without the Bottleneck

The most dangerous place for a Tech Lead is the “Ivory Tower” where you stop coding entirely and start drawing diagrams that don’t actually work in reality.

However, the second most dangerous place is remaining the “Hero.” If the team can’t ship without you reviewing every line or fixing every hard bug, you haven’t led; you’ve just become a chokepoint.

I maintain technical credibility by taking on “Glue Work” and “Hard Problems.”

  • The Glue: I maintain the CI/CD pipeline, the Docker setup, and the core ApplicationService base classes. This keeps my hands in the code daily but doesn’t block feature delivery.
  • The Hard Problems: I step in when there’s a production outage or a complex architectural spike that requires deep Rails internals knowledge.

But for feature work, I delegate. I might write the initial “walking skeleton” of a new module to set the standard, but then I hand it off. I swap the pride of “I built this” for the pride of “My team built this.”

4. The Metrics I Care About

As a Senior, my vanity metrics were Commit Count and Story Points. As a Lead, those metrics are dangerous. If I have the most commits, I am likely failing at delegation.

I now care about different metrics:

  • DORA Metrics: Specifically, Deployment Frequency and Lead Time for Changes. I want to see the team shipping small, safe batches frequently. This requires a robust Rails testing suite and a culture of small PRs.
  • Review Latency: If PRs are sitting in the queue, I am the bottleneck. I track how fast we turn around reviews. A fast review cadence is a competitive advantage.
  • Bus Factor: Can the team deploy if I am on vacation? I actively work to reduce my own bus factor by documenting architecture, recording loom videos for tricky systems, and pairing with others on the parts of the app I used to own exclusively.

5. Guarding the Culture

Finally, the code I write is still read by humans. As a Lead, I set the tone for the emotional state of the team.

When I write code now, I admit when I don’t know something. I write PR descriptions that explain the context and the “why.” I comment on my own code to highlight trade-offs I made.

In a Rails stack, it is easy to be a purist. But a Lead needs to be a pragmatist. I write code that fits the project’s constraints, the team’s skill level, and the business timeline.

Summary

Moving from Senior to Lead meant giving up the dopamine hit of “shipping the most.” In exchange, I gained the satisfaction of building a system where everyone ships better.

I still love Rails, but I’ve learned that my best code is now the code I don’t have to write, because I’ve successfully mentored someone else to write it better.