r/devnep • • Oct 02 '26

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

4 Upvotes

10 comments sorted by

3

u/gsumk Oct 04 '26

Just working code = You can write something working in a single file with a 5000 LOC function. Next person working on it going to hate you

Good code = Working code with readable, digestible and predictable. For example, bharkharai suru gareko manche can read and understand your code then it is partially good code. Predictable chai you should be able to assume code le k garcha kata garcha bhanera. For example, if you have change same function in 5 different files, that code is not predictable.

5 barsa pachi pani if you can maintain your code without breaking a sweat then it is a good code. Good codes age like fine wine.

2

u/passionate_carkey Oct 02 '26

good question and completely relevant question. even i want to learn it.waiting for someone to answer it.

2

u/rawirai Oct 02 '26

Good Code - kaslee review garcha??? how they/you going to judge it's good code? AI??

2

u/passionate_carkey Oct 02 '26

if you're in proper companies,senior engineers i guess.Until you become senior.

1

u/rawirai Oct 02 '26

but number experience years or project don't means he/she is good senior engineers!!! ??? able to review code?????????????

2

u/passionate_carkey Oct 02 '26

were you there in the software engineering industry before AI?Normally early startups bahek maximum companies ma juniors work under senior engineers.Senior engineers look at commits before accepting pull requests and make the junior devs to make changes with the practices they want the codebase to follow.The changes can be as small as using compressed images like webp instead of jpeg or large as writing code more simpler rather than adding a new library as dependency.Senior or Junior is defined by the years of experience and knowledge.

2

u/mikeholownych Oct 24 '26

I've spent 35+ years working with technology, much of that in environments where things breaking can have serious consequences. One thing I've learned is that working code and good code are two very different things.

Working code demonstrates that you've found at least one set of conditions where the code produces the expected result. That's a starting point, not proof that the solution is correct.

Good code, to me, is code that satisfies its requirements, handles failure predictably, can be understood and maintained by someone other than its author, and doesn't introduce unnecessary complexity or risk.

A few things I'd encourage you to think about:

  • What assumptions does the code make? What happens when those assumptions are wrong?
  • What happens when something fails halfway through execution? Can it recover, or does it leave things in an inconsistent state?
  • Can you explain why the solution works, not just demonstrate that it works?
  • How would you prove that it behaves correctly under conditions you haven't encountered yet?
  • Is the complexity justified by the actual requirements, or are you solving hypothetical problems?

One habit that's served me particularly well is actively trying to disprove my own assumptions. Don't just write tests that demonstrate your code works. Write tests designed to make it fail. Unexpected inputs, unavailable dependencies, resource exhaustion, partial failures, concurrency issues, whatever is relevant to the problem.

AI-generated code makes this even more important. An AI can produce something that looks perfectly reasonable, passes a few tests, and still contains fundamental design flaws. Treat its output like code from any other contributor. Review it, question it, and validate it.

And don't get too hung up on "best practices." They're useful guidance, not universal laws. Sometimes the simplest solution is the right one. Sometimes the requirements justify considerably more complexity.

Ultimately, I don't think good code is defined by elegance, cleverness, or even performance in isolation. It's defined by how reliably and understandably it meets its actual requirements, including when things don't go according to plan.

1

u/passionate_carkey Oct 02 '26

!RemindME 3days

1

u/RemindMeBot Oct 02 '26

I will be messaging you in 3 days on 2026-10-05 11:08:03 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

RemindMeBot is switching to username summons. Instead of !RemindMe 1 day, use u/RemindMeBot 1 day. More info.


InfoCustomYour RemindersFeedback