Comment by skissane
6 days ago
> When stuff slips through code review, even if it is a mistake you might have made, you would remember that you made it.
I don’t know. Ever had the experience of looking at 5+ year old code and thinking “what idiot wrote this crap” and then checking “git blame” and realising “oh, I’m the idiot… why the hell did I do this? struggling to remember” - given enough time, humans start to forget why they did things a certain way… and sometimes the answer is simply “I didn’t know any better at the time, I do now”
> You don't get that with AI. The codebase is always new.
It depends on how you use AI… e.g. I will often ask an AI to write me code to do X because it gets me over the “hump” of getting started… but now this code is in front of me on the screen, I think “I don’t like how this code is written, I’m going to refactor it…” and by the time I’m done it is more my code than the AI’s
Understanding code takes more effort than writing it, somehow. That's always been a huge problem in the industry, because code you wrote five years ago was written by someone else, but AI coding takes that from "all code in your org except the code you wrote in the past couple years" to "all code was written by someone else".
How well does your team work when you can't even answer a simple question about your system because nobody wrote, tested, played with the code in question?
How do you answer "Is it possible for our system to support split payments?" when not a single member of your team has even worked on the billing code?
No, code reviews do not familiarize an average dev to the level of understanding the code in question.
> Understanding code takes more effort than writing it
yes!
> somehow
not difficult to explain. Coding is a creative activity where you work top-down; you decompose the abstract/high-level into the detailed/low-level. You dictate the "events" happening to the code, you are in control. Reviewing is reactive; the code you review dictates what happens in your brain (you are under control, not in control), and you need to work bottom-up: you try to re-compose the whole from the fragments. Even for human coders, a detailed commit message is a pre-requisite before their code can undergo review. The reviewer is in the worse position, so he needs to be supported as much as possible.
Oddly, I don't tend to get that experience very much. More often, it's "That's not how I'd naively write that code, there must be some catch to it. If only I had the foresight to write a comment about it..." Alas, I'm still not very good at writing enough comments.
Now this is where AI assisted coding shines in my opinion.
I find myself both:
- writing a comment so that Copilot knows what to do
- letting Copilot write my comment when it knows what I did
I'm now a lot more reliable with my comment writing.
> why the hell did I do this? struggling to remember
- git blame
- always write good commit messages
5 years? You’re a genius. I can’t make sense of stuff I wrote last week.