Questions tagged [code-reviews]

This tag is for questions about the practice of code review and code walkthroughs. For reviews of existing, working code, please see http://codereview.stackexchange.com

A code review is an examination of the code by other programmers. The goal of a code review is often to find and fix mistakes that were missed in the earlier phases.

For asking about code reviews of specific code (rather than the process of doing a code review), please see http://codereview.stackexchange.com. Before asking a question there, make sure that it is appropriately on topic.

359 questions
355
votes
19 answers

How would you know if you've written readable and easily maintainable code?

How would one know if the code one has created is easily readable, understandable, and maintainable? Of course from the author's point of view, the code is readable and maintainable, because the author wrote it and edited it, to begin with. However,…
KyelJmD
  • 971
  • 5
  • 10
  • 20
195
votes
22 answers

How do I handle disagreement in a code review regarding an unlikely edge case?

I am working at a robotics startup on a path coverage team and after submitting a pull request, my code gets reviewed. My teammate, who has been on the team for more than a year, has made some comments to my code that suggest I do a lot more work…
Klik
  • 1,665
  • 2
  • 10
  • 10
194
votes
20 answers

How to find positive things in a code review?

After some serious quality problems in the last year, my company has recently introduced code reviews. The code review process was quickly introduced, without guidelines or any kind of checklist. Another developer and I where chosen to review all…
RobMMurdock
  • 1,651
  • 2
  • 10
  • 7
187
votes
19 answers

How do I review my own code?

I'm working on a project solo and have to maintain my own code. Usually code review is done not by the code author, so the reviewer can look at the code with the fresh eyes — however, I don't have such luxury. What practices can I employ to more…
Max Yankov
  • 901
  • 2
  • 9
  • 17
158
votes
34 answers

How do you make people accept code review?

All programmers have their style of programming. But some of the styles are let’s say... let’s not say. So you have code review to try to impose certain rules for good design and good programming techniques. But most of the programmers don’t like…
user7197
151
votes
16 answers

What do you do when code review is just too hard?

OK so a lot of code review is fairly routine. But occasionally there are changes that broadly impact existing complex, fragile code. In this situation, the amount of time it would take to verify the safety of the changes, absence of regression, etc.…
Bradley Thomas
  • 5,090
  • 6
  • 17
  • 26
139
votes
16 answers

How can I tactfully suggest improvements to others' badly designed code during review?

I'm a great believer in clean code and code craftsmanship, though I'm currently at a job where this isn't regarded as a top priority. I sometimes find myself in a situation where a peer's code is riddled with messy design and very little concern for…
Yony
  • 1,647
  • 3
  • 12
  • 14
119
votes
8 answers

What to do when code submitted for code review appears to be too complicated?

The code is difficult to follow but it appears to be (mostly) working well, at least with superficial testing. There might be small bugs here and there but it's very hard to tell by reading the code if they are symptomatic of deeper issues or simple…
Bradley Thomas
  • 5,090
  • 6
  • 17
  • 26
113
votes
15 answers

Should I point out spelling/grammar related mistakes in someone's code?

While reviewing a co-worker's code, I came across some spelling mistakes in function names and also grammatical errors like doesUserHasPermission() instead of doesUserHavePermission() in function and variable names. Should I point these out to him…
Rahul
  • 2,119
  • 2
  • 14
  • 23
111
votes
11 answers

Is it effective to review code in language I don't know?

I'm an experienced developer, but have not done many code reviews. I'm being asked to review code written in Python but I do not know Python. Does it make any sense at all to review code in a language I don't know?
Heather Smith
  • 1,001
  • 2
  • 7
  • 4
95
votes
11 answers

In code reviews, should the reviewer always present a solution for issues?

When reviewing code, I normally try to make specific recommendations on how to resolve the issues. But owing to the limited time one can spend for reviewing, this does not always work well. In these cases I find it more efficient if the developer…
Frank Puffer
  • 6,411
  • 5
  • 21
  • 38
91
votes
8 answers

How to reject a code review that you believe is unnecessary?

I am in a position where I have been asked to review some code that fixes a problem that I don't believe exists. The fixer, who is more senior than me, insists his fix is necessary but it appears to be no more than C++ sophistry to me. Part of…
James
  • 4,328
  • 3
  • 21
  • 25
88
votes
21 answers

How would you react if someone told you your code is a mess?

I am a good programmer, or so I thought before. I always love to program. And I want to learn many things about programming to make me a better programmer. I studied programming for 1 year and now I am working as a programmer for almost 2 years. So…
newbie
  • 791
  • 2
  • 8
  • 12
85
votes
23 answers

How important is it to reduce the number of lines in code?

I am a Software developer who works on J2SE (core java). Often during our code reviews we are asked to reduce the number of lines in our code. It's not about removing redundant code, it's about following a style that focuses on doing the same things…
Ankit
  • 949
  • 4
  • 11
  • 15
79
votes
4 answers

What is the purpose of a Code Review

I am in the process of trying to sell my organisation on the value of code reviews. I have worked at several places where they were employed. I have seen them used to nitpick styling choices, and functional decisions, and I have seen them used as…
SoylentGray
  • 3,043
  • 1
  • 23
  • 31
1
2 3
23 24