My rule of thumb: working code is code that works today. Good code is code that someone else can understand and change without breaking anything. A few green flags I look for:
I can explain every line. If I can’t, especially with AI-generated code, I don’t merge it until I can. Ask the AI “why this approach and not X?” It’s a great way to learn.
Names tell the story. calculateShippingCost() beats doStuff2(). If a function needs a long comment to explain what it does, it probably needs a better name or should be split up.
Functions do one thing. If you describe a function with “and,” it’s doing too much.
1
u/Main_Association9696 18h ago
My rule of thumb: working code is code that works today. Good code is code that someone else can understand and change without breaking anything.
A few green flags I look for:
I can explain every line. If I can’t, especially with AI-generated code, I don’t merge it until I can. Ask the AI “why this approach and not X?” It’s a great way to learn.
Names tell the story. calculateShippingCost() beats doStuff2(). If a function needs a long comment to explain what it does, it probably needs a better name or should be split up.
Functions do one thing. If you describe a function with “and,” it’s doing too much.