Learning to be a developer when AI can write the code
Sometimes I feel like AI hijacked part of my experience of learning to code.
During my software engineering degree apprenticeship, and while still figuring out what it means to be a good developer, the way we write software is constantly evolving. AI native development is a term I hear a lot. I can get from an idea to working code much faster than I could on my own, however, I’m not sure how much of that speed I can call progress.
The thing I find hard to admit is that sometimes I wonder whether I’m actually a good developer.
That question usually gets me nowhere. A better one is what I can do when the code in front of me stops behaving the way I expect.
Can I work out where it went wrong?
Can I explain why I’d fix it one way and leave another part alone?
If I change it, can I show that I’ve fixed the problem?
I want to use this site to find out. I’ll take one feature at a time, start with what I think the code is doing, and see how far I get. Sometimes I’ll ask AI to help me read unfamiliar code. Sometimes I’ll ask it to suggest a test I’ve missed. I want to write about the moments where I thought I understood something and then had to go back and look again. I suspect those will be the most interesting parts.
I’m building this website with AI too, which makes it a good place to start. There’s a little experiment on the homepage about splitting £100 between three people. Round each share to £33.33 and you end up a penny short. You can fix that in a few lines. The part I want to get better at is thinking to ask where the penny went.
where did it go?
£33.33 × 3 = £99.99 — 1p short
// The AI’s draft
function splitBill(total, people) {
return Array(people).fill(Math.round(total / people));
}
// My fix: whole pence, hand out the leftovers
function splitBill(total, people) {
if (!Number.isInteger(people) || people < 1)
throw new RangeError('Need at least one person');
const base = Math.floor(total / people);
const extra = total % people;
return Array.from({ length: people },
(_, i) => base + (i < extra ? 1 : 0));
}
£33.34 + £33.33 + £33.33 = £100.00 ✓
Amaka