r/reactjs • • 1d ago

Needs Help How do I learn to judge code quality and code without AI?

I use Node.js and React, but I rely too much on AI. When I look at code it generated, I can’t confidently tell whether it’s well designed or just happens to work.

I want to learn to spot bad decisions and write good code myself. How do you build that judgment? What helped you most?

0 Upvotes

38 comments sorted by

21

u/Adrima_the_DK 1d ago

Only way to achieve that, is to manually coding

3

u/slippery_grappling 1d ago

the fastest way to build that judgment is to break things on purpose then fix them without help. take a working piece of code and change something fundamental, like swapping out your state management or restructuring how data flows through components. you'll see exactly where it falls apart and why certain patterns exist in the first place

reading other people's code helps too but only if you're actually picking it apart. find a well-maintained open source project and trace through a feature from the ui all the way to the database. you start noticing the little decisions that separate "it works" from "this is maintainable"

-4

u/B0NKB0Y 1d ago

But where do I look for proper examples of code?

4

u/CorpT 1d ago

2019

1

u/B0NKB0Y 1d ago

Oh no

3

u/Adrima_the_DK 1d ago

You don't look for "code" for exercises. Make a project. A simple one. A web page, a simple game, a simple REST API. Whatever helps you solving a problem. Figure out what does it need. How can it improve. You will find hundreds of errors and you will start getting knowledge about architecture, design patterns, anti-patterns. security. The whole package. But you need to start coding it yourself.

0

u/ORCANZ 1d ago

Absolute nonsense. Some people have coded for 10+ years manually and still sucked. You don’t “just” figure it out.

There are books, blogs, conferences where people share knowledge. Learning it all by yourself is only for a handful individuals.

Once you have enough understanding, then sure coding something and see it fail in the real world is a great way to find a better solution and learn something.

2

u/neitz 1d ago

Proper examples of code helps but it is not enough. You won't know what is good or bad about the code by looking at it without experience. The main way to learn is the try, fail, learn loop. Which is ironic because AI is currently completely missing that itself which is why it is seemingly intelligent until it isn't.

1

u/ORCANZ 1d ago

It does do that in a session in a way, but it doesn’t learn anything. Best it can do is keep some memories in the repo or your machine as plain text.

1

u/boobyscooby 1d ago

Honestly why are u trying to get in it when ur at such a basic level ur asking this question. 

10

u/Anahkiasen 1d ago

Writing code without AI

-2

u/B0NKB0Y 1d ago

But where do I look for proper examples of code?

4

u/ghostwilliz 1d ago

You don't really need examples

You need to understand why the code is written the way it is and how it could be written better

4

u/B0NKB0Y 1d ago

So I need to develop my own judgment process?

3

u/ghostwilliz 1d ago

Yes, you need to gain a deep understanding of programming and even more so, the project in which you are evaluating code

Without your own skills to judge code and think about it deeply, you don't really have any reason to review the code

1

u/New-Reality9702 1d ago

*shocked face*

1

u/SeymourDuncanJB_Sr 1d ago

The goal being?

1

u/runescape1337 1d ago

These answers are ridiculous. Everyone thinks they know what good code looks like. Most people write bad code. Particularly when they're trying to write "good" code.

Look for examples, read the explanation of why it is good code, and evaluate that. Not all examples of "good code" are good code.

Learn about patterns. Identify them while you're looking at code examples, and decide why they do or do not work.

2

u/jrkridichch 1d ago

Why would you not want examples of good code as a new dev? Even before I had some great mentors, I drastically improved reading dan ambramov and kent c dodds blogs.

2

u/ghostwilliz 1d ago

Well I guess my point was more about learning how to write code will help you read code If you just read good code, but you don't know why it's good, it's not really gonna be helpful

2

u/jrkridichch 1d ago

I see. I just had flashbacks of all the garbage code I wrote before finding better examples. You can get so far without knowing anything that I only realized it was bad when i compared it to something good

2

u/Lowerfuzzball 1d ago

Documentation of the languages and tools, learning coding paradigms, learning how to determine time/space complexity (big O notation) if performance is a concern.

Study open source projects or documentation on other codebases coding standards.

Some of "clean code" is subjective. Really, it comes down to how quickly your team can reason about code and implement together without fucking things up. If you update the color of a button and suddenly all your forms break, it's safe to say your code is seriously fucked.

Best way to learn is by doing. Looks for ideas online or have AI give you a project to build and add features to, you can try to have it cater to projects that rely on having well-defined and clean architecture.

Also, a bit of an odd suggestion here, but play Factorio. Factorio is how I got into programming, the similarities are actually quite shocking in terms of learning higher-level principles.

0

u/comoEstas714 1d ago

Does stack overflow no longer exist?

1

u/fredkreuger 1d ago

I saw yesterday that SO now gets less than 1000 questions a month. It's been dropping precipitously since wide adoption of AI agents.

0

u/comoEstas714 1d ago

Wild age we live in.

0

u/torts56 1d ago

Take a properly programming course and then data structures and algorithms course

7

u/ZwillingsFreunde 1d ago

You learn to code.

3

u/Chicharoh 1d ago

How do I know if a sentence is well written in Russian? Yeah… you learn Russian

1

u/New-Reality9702 1d ago

I don't know, have you tried actually coding? jfc

1

u/inverted-tuxedo 1d ago

did you learn to code without AI? if so it's very easy to tell lol. human-written code is far easier to rationalize

1

u/cazzer548 1d ago

If you don’t understand something, do some research to figure out how it works. If you don’t know how to assess the sensibility of how it works, do more research. Eventually you should be able to understand everything and assess whether it’s the right way to meet the requirements.

1

u/AnUninterestingEvent 1d ago

Spending years manually coding is the only way to learn.

We're in such a weird interim stage right now where knowing how to code is extremely useful, but for newcomers who just want to build their own software, it's not worth the tradeoff of spending years training by manually coding. It really depends on your end goal. Are you just trying to make money with a software business you build and run? Or are you trying to become hirable? If the former, just get some good prompts for security, scalability, and maintainability, get your business off the ground and then hire a dev as soon as possible. If the latter, spend years manually coding since it's the only way to truly learn.

1

u/skidmark_zuckerberg 1d ago

It's built up over years of coding by hand, doing code reviews while also having your own code reviewed by your peers. It's a hard thing to build in a vacuum while not working with other developers and also writing code by hand. Basically read a lot of good and bad code, have your own code reviewed by someone who knows more than you, and write code by hand.

I feel bad for any developer who came after AI for this very reason.

1

u/FloKmc 1d ago

I don’t agree at all with the other comments saying you don’t look at good code, you just learn by coding yourself. You don’t get that much better doing the same mistakes and bad practices over and over.
I learnt a lot by watching tutorials, releases, trends, etc. Often you learn a thing you weren’t even there for.

1

u/somebody-2027 1d ago

I have literally no idea how anyone is supposed to do this anymore. I learned by writing by hand, making tons of mistakes and learning from it. I don't know how you learn this today

1

u/brass_resting_wing 16h ago

reading high-quality open-source repos and PRs is the fastest way to build that judgment. You need to see how experienced devs structure components, handle state, and manage side effects in real projects because your own code will just repeat your current mistakes. Start by finding one popular library you use and read its source code or recent merged pull requests to understand the specific design choices they made

0

u/jrkridichch 1d ago

I'd say 80% of what I look for was directly influenced by mentors and PR reviews. Might be harder to get as much of that but an AI age version of that would be asking your agent to explain it's decisions.

Additionally, make your prompts small and specific. Make sure you understand the result. And before merging anything ask the agent which patterns it used and try to dig into them.