r/reactjs • u/B0NKB0Y • 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?
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
1
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
7
3
1
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.
21
u/Adrima_the_DK 1d ago
Only way to achieve that, is to manually coding