LLMs are ruining junior developers
Okay I've gone from being an LLM evangelist to thinking it is a scourge on development as a whole. I am so grateful I learned to code without it. Three things that I think have happened:
- People's PRs are now 1600 lines long by default. It's much too easy to just write immense amounts of code, write some tests that look passable, then hand off responsibility to your reviewers to essentially re-prompt the LLM with fixes. Now your reviewers are either: LLMs that think their own code is great, or humans that literally can't review the code because it's too long.
- People who do not have years of coding experience do not review their own code. They think they understand it and they think it works but it does not and they do not.
- Junior developers are in a race to the bottom, if you aren't producing as much code as your peers you're gonna be seen as less, so there's pressure to over rely on LLMs to keep up. Now you're not learning, and ultimately you are a glorified LLM because you don't know enough to question the code they're producing.
How do you have the time to become an equivalent senior when there are no jobs willing to give them the time it takes to become a senior?
I am so grateful to have never had the option of asking the Almighty Child to write up some code I didn't understand. If I had it, I would have used it, and I would have been a measurably worse developer (and prompter).
LLMs have left their mark. Believe what you want about a bubble, a developer is not the same person as they were five years ago, and I can't see the entire industry collectively deciding to just stop using the thing that in the best case DOES make its people more productive.
So, the least we can do for our younger selves is find ways to make sure there is still space for learning. The pressure driving juniors towards this is social, so we need a social solution. Ultimately it's the same old problem, how do we reward steady improvement over productivity? I don't know, I hope that given the moment where that's my decision to make, I remember the lessons foisted upon me.
But I'm not, so are there ways of curtailing LLMs to only behaviours that are least likely to produce bad code? There are a million guides on prompting online, I'm not particularly good at it. But I do think there are a couple of simple things we can do.
Test Driven Development
I used to be a bit of a fanatic. Then I needed to make a change to the code I had written because (shockingly) I hadn't known the full scope of the problem I was solving. Cue about 50 unit tests ensuring every conceivable edge case was covered failing. A simple change took an hour. Moderate changes took days. It's not fun to write TDD code, and it's even more not fun to update TDD'ed code.
TDD is great in theory, bad in practice.
Anyway, I don't think there is an excuse to not do test driven development anymore. LLMs are good at writing lines of code. One of the great things about TDD is how it forces you to think about what the outputs of your code before you write it. In LLM world, your tests are a spec. They are context without(ish) the risk of context rot. They should be written up front, and understood by the developer.
Then, the LLM can write code. It should never update the tests. If you're a junkie, this is where you --dangerously-skip-permissions.
Limit the size of PRs
Big PRs hurt. They hurt to review, they hurt to receive reviews on.
They hurt LLMs even more. A single comment asking for an architectural change in a 2,000 line MR is simply untenable for an LLM to effectively correct for.
So, make your PRs small. If not for your reviewers or yourself, for your poor LLM. It's trying its best.
Commit hooks
One thing that has become clear over time working with Claude is that there are certain patterns that it defaults to. I suppose that's a reflection of us. Some examples from my beloved Go:
- Using
defer and context.Background() instead of t.Cleanup(..) and t.Context() in tests. This annoys me endlessly and I can't think of a reason not to use these.
- Inserting a space between a function call and the subsequent
if err != nil {..} check
- I'm sure I'll think of more and wish I added them to this list
It hurts nobody to add a commit hook checking for these. Do that. Anything that you think 'add this rule to our CLAUDE.md', first ask yourself 'can this be a commit hook'.
I don't know how to enforce these things in practice, but I think it is done socially, not through some LLM config CLAUDE.md file. Agree on a limit in your team and reject PRs longer than that limit. There are ways to split PRs up. It's a skill that everyone needs to master.
Maybe also update your reviewing LLMs to speak out about it too, maybe people trust those more than humans these days.
All of this is predicated on the idea that my own journey was the best one. Growing up we are all confronted with adults imposing their views on us, but the truth is we all grow up in a different world. My lessons aren't those of my predecessors, and won't be those of my successors. The skills that the juniors are learning on their own will be more important than the lessons I can teach them.
But what has been true of my predecessors and will be true of my postdecessors, we all have to try our best.