🔁 Crossposted from c/code-reviews · Show us your code and let the community tear it apart constructively.
Show us your code and let the community tear it apart constructively.
Writing code alone can create blind spots.
You know why you wrote a particular function. You know what a variable was supposed to represent. You know which shortcut was temporary. After enough time, all of those assumptions become invisible to you.
That is why code review is useful.
Post a piece of code you've written and tell us what it does, what language it uses, and what kind of feedback you're looking for.
Maybe you want suggestions for readability. Maybe you're wondering whether your architecture is sensible. Maybe there is a performance concern. Maybe you're uncertain about security, testing, naming, error handling, or how the code will behave as the project grows.
Constructive criticism is encouraged.
"Your code sucks" isn't useful. Explaining why something may become difficult to maintain is useful.
Also, reviewers should remember that not every project needs enterprise-level architecture. Sometimes simple code is exactly the right solution.
For people posting code, don't just ask whether it "looks good." Ask specific questions. That makes it much easier for reviewers to provide meaningful feedback.
Post something you've written recently and tell us what you want other developers to look at.
