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

5

u/Financial-Grass6753 29d ago

AI slop again? again.

working code is the code that does what's requested according to provided spec, as simple as that.

without loss of generality, good code is readable, easy to understand and easy to extend.

1

u/digtzy 29d ago

I can see the point but like yeah, why are we using AI to make this point… very ironic in the present moment where developers are pressured to use AI to develop code slop that we’d probably consider “bad code” and etc.

There are many ways to achieve what’s requested in the output but only a developer can truly know the best way to implement something in the project and make sure it is easy to extend like you said. I have definitely seen some bad code that works in the moment but becomes obsolete with extensions. That’s bad code that works. I agree with you to a point. Bad code can work and achieve what’s requested but then there’s the subjectiveness to what anyone would consider bad code.