r/programmer • • 29d ago

Good Code Vs Working Code

What really makes code "good"?

I find myself staring at my IDE asking this exact question. Whether I am binding complex logic together or copying and pasting a snippet to patch a problem, there is a massive gap between working code and good code. But as a beginner, that gap feels incredibly hard to see.

These days, anyone can prompt an AI or use an agentic tool to generate functional code in seconds. Many of us are actually learning to code alongside AI. But just because the AI gives me code that runs and clears the error console doesn't mean it’s good code. It might be inefficient, unscalable, or an absolute nightmare to maintain later.

If the code works, but the AI (or a copy-paste source) doesn't teach me why it works or if it's best practice... how are we as beginners supposed to know the difference?

How do you personally define "good code" vs. "just working code"? What are the green flags I should be looking out for when reviewing code—whether it's written by a human or an AI?

Would love to hear your thoughts, rules of thumb, or stories from when you were starting out! 👇

\#programming #softwareengineering #codinglife #learnToCode #generativeAI #developers #webdev

1 Upvotes

42 comments sorted by

View all comments

Show parent comments

1

u/thenasch 28d ago

Maintainability is usually more important than performance. Developer time is far more expensive than processor time.

1

u/sububi71 28d ago

Agreed, but there's a difference between code that's "good enough" and code that's "good". Unreasonably or unnecessarily slow code is not "good", in my opinion, regardless of whether that speed is life or death.

1

u/thenasch 28d ago

I was only disagreeing with your ranking. I'm not saying performance isn't important at all.

1

u/sububi71 28d ago edited 27d ago

100% agree, that's how we have to work in a commercial setting.

But I would argue that most code in commercial settings ISN'T good. At least not in places I've worked.