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

learn more… | top users | synonyms (1)

-1
votes
0answers
17 views

Standalone tool for code review that outputs a document of common format [on hold]

I'm looking for a tool (online or desktop) that I can paste code into, add some comments inline and send the end result to my team. The end result may be an image or html page, or pdf of the code with ...
1
vote
0answers
31 views

How can I test for performance issues in a specific piece of code? [duplicate]

I've inherited a problem from a programmer that isn't with our group anymore - a piece of our application suffers from performance issues under a particular set of circumstances. I can replicate ...
100
votes
11answers
10k views

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 ...
0
votes
1answer
102 views

Code Reviews: Working around the Github Pull Request limits [closed]

I'm currently working on a project where we introduced Github into our workflow. We started noticing that we get into the Github PR size limits pretty fast: This problem happens especially when we ...
2
votes
0answers
95 views

Documentation of code review

In a project we have a rather formal code review, which is currently done manually and documented in Excel sheets and Word docs. We would like to improve the current code review process by ...
3
votes
3answers
94 views

Relational table design for data ownership

Setup (schema simplified for clarity) Suppose I have a table called resource: +---------------+--------------+------+-----+ | Field | Type | Null | Key | ...
1
vote
1answer
115 views

Sorting Array before looping : best practice

I was going through JBAKE code at https://github.com/jbake-org/jbake/blob/master/src/main/java/org/jbake/app/Asset.java : 58 PFB the code. Why are we sorting the array here? if (assets != ...
-1
votes
1answer
167 views

eradicating the array = loop mindset [closed]

I have noticed a common issue in code reviews, that takes this form: // "arr" is an array for (i = 0; i < arr.length; ++i) { if (i == 3) { // do something with arr[i] } if (i ...
11
votes
1answer
307 views

How to do peer reviews on GitHub pull requests?

We're moving from Bitbucket to GitHub and one thing we are struggling with are peer code reviews that worked very smoothly on Bitbucket like this: Author opened a Pull Request (GitHub: the same) ...
-2
votes
1answer
195 views

Searching for 2 numbers that equal 10 [closed]

During an interview today I was asked to write a function that accepted an array of integers and return the positions of two values in the array that the sum was 10. My code was C# public string ...
2
votes
3answers
208 views

What is the most readable way of passing arguments to the function? [closed]

I'm using JavaScript but the question can be generalized to all the languages. In a nutshell - I'm checking if a browser connecting to my site is a microwave and cater for that accordingly. What ...
1
vote
1answer
155 views

Interface Implementation: A parameter I don't need

Pseudo-Code interface IPagingInfo { int CurrentPageNo { get; } int RowsPerPage { get; } ... } interface ResultsRetriver { ResultRows GetResults(IPagingInfo pagingInfo); } class ...
1
vote
1answer
133 views

Interface Design: Specific vs General parameter (A Minimal design vs anticipated use variation)

Code public interface IVehicle { string VehicleMake { get; } int MonthsSincePurchase { get; } bool IsApprovedUsed { get; } ... } public class WarrantyPopUpHandler { virtual bool ...
4
votes
2answers
103 views

How to help programmers use existing shared classes, instead of reinventing them? [duplicate]

My company has a fairly large software project (a couple million lines of code spread across many assemblies.) One sticking point we've consistently run into during code reviews has been with the use ...
3
votes
4answers
295 views

Minimal design vs anticipated use

Recently when performing a code review I came across something like this: Old Code: WriteLabour(useNewVersion); WritePart(); WriteNonLabour(useNewVersion); New Code: WriteLabour(); ...
0
votes
1answer
158 views

How long should a code review be? [closed]

Where I work, we are eight software developers and every task done must be reviewed by another developer. Often, I feel like the code reviews are done too quickly (example: a task completed in five ...
2
votes
1answer
103 views

How to encourage code review with team members working on different projects and platforms

With the previous team I used to work with, we used to work on the same project at the time. Or at least we used to use the same platform/programming languages. Code review was almost daily routine ...
3
votes
1answer
81 views

Merging from unfinished feature branches and code review

We are using the git flow workflow, and it sometimes happens that we have long-lived feature branches. Of course we can merge from the develop branch into our feature branch, when another feature ...
14
votes
5answers
335 views

Code review lags behind the Deliver/Test Cycle

In our Agile process we have 2-week Sprints. Tasks are delivered on a daily basis (daily builds), and the Test Team completes their testing immediately the next day or even the same day. We also have ...
6
votes
5answers
412 views

How to promote code review as an employee? [closed]

I have just graduated not long ago and started to work in a startup company for almost a year. I have introduced git to my current company and they are now happy to use it for version control. I feel ...
47
votes
7answers
5k views

What is the actual value of a consistent code style

I am part of a consultant team implementing a new solution for a customer. I am responsible for the majority of code reviews on the client-side codebase (React and javascript). I have noticed that ...
2
votes
1answer
82 views

Code review and testing in the process

I am thinking about the software development process of my team, more specifically, I am thinking about tests and code review into our development process. I came to the conclusion that, in order to ...
4
votes
2answers
148 views

Should static analysis be integrated with code review? [closed]

I want to integrate various static analysis tools, and then add the results as comments on a file within code review tools, such as Stash or Review board. I am exploring the feasibility of writing ...
10
votes
1answer
691 views

When making a fix to an earlier commit, should I rebase or add a separate fix up commit?

A common scenario in software development is code reviewing somebody else's code. A common tool for doing this is opening a Pull Request. My question is, when issues are found in the review, should ...
1
vote
4answers
173 views

What practical steps do you take to ensure you are thorough? [duplicate]

Bit of Context I'm not sure if this is fitting to the programmers.stackexchange area, but I'm not going to post it in SO. Any problem with ambiguity and I'll happily remove it. If I had to talk ...
1
vote
0answers
100 views

How to approach code review with limited resources

I've been given the following task: A company is giving source code for its product (comprising over 1 million lines of C++, Java, with some assembly) for my review. The code will be loaded ...
6
votes
5answers
830 views

What is the effectiveness of code reviewing by just reading? [duplicate]

I have been given the task of reviewing a change request comprising of more than 20 changes, the problem is that we do not / cannot install a version of the software to be evaluated as the development ...
27
votes
7answers
4k views

How to monitor code review efficiently?

I suspect major code review cover up in my team. Too many code reviews are merged without any comment. Seems to me like there's no such thing as a code review without a single comment. How can I ...
1
vote
2answers
255 views

Why is there only code review?

In my team I have applied a culture of code review and feature review. The code might look great, written spectacularly, however the feature might not work. It seems to me as 2 different scopes ...
54
votes
9answers
10k views

Bad sign if nobody can comprehend one's code? [duplicate]

If a coder writes code that nobody other than he can understand, and code reviews always end with the reviewer scratching his head or holding their head in their hands, is this a clear sign that the ...
4
votes
1answer
106 views

In 'branch by abstraction', how would one do code review?

My manager recommended I consider the technique of 'branching by abstraction', in which, rather than creating feature branches, multiple developers work in the same version control branch, and ...
6
votes
2answers
135 views

peer review code documentation [closed]

We all know that code reviews are generally a good practice, but what about reviewing documentation? Many devs that I work with will put up wiki pages, javadocs, etc, but most of the time, unless ...
3
votes
1answer
249 views

Been working on a project for the last 6+ months. Consultants have been brought in and want to change everything. What should I do? [closed]

Long story short, I have been the sole front end developer on this project since last summer. Consultants have been brought in to help accelerate our velocity. After one day and some knowledge ...
1
vote
1answer
81 views

How to avoid old commits/PRs that are painful to merge?

We have a pretty good code review process, but there are couple of issues. The most annoying problem is merging. From time to time the number of stuff to merge grows rapidly and some of the commits ...
1
vote
0answers
77 views

Reject pull request or accept incorrect code? [duplicate]

Very often I have to review pull requests of fellow programmers and I face the problem - what should I do when the code is not as good as I would expect? Should I reject the pull request or ...
-1
votes
1answer
107 views

How to get people to actually do code reviews promptly? [duplicate]

First things first, our company has decided to do code reviews. All of the engineers agree with (or accept) this. Code reviews are required as part of our development process for all commits. The ...
12
votes
1answer
680 views

Does pair programming remove the need of code reviews in an Extreme Programming (XP) project?

In an extreme programming project, programmers do pair programming most of the time. As these pairs also rotate, that is, you pair program with different people, and there is a sense of collective ...
4
votes
2answers
2k views

Do we still need manual code review if we use sonarqube code review tools

We were using git gerrit for manual code review . but recently we are planning to integrate sonarqube in our Jenkins integration server. Do we still need manual code review? Or we can stop manual ...
1
vote
1answer
109 views

How do I review code changes that are the result of syncing?

At my current job we develop code on a release branch and then do a code review. After all rework is done the final changes are also synced/merged to the 'main branch'. We want to be sure that all ...
1
vote
1answer
650 views

How to find duplicate strings

I allow my user to create profiles, meaning they potentially could create some with duplicate names. This can be problematic so I want to prevent them from doing so. I coded up this first pass ...
31
votes
10answers
3k views

How to deal with no code reviews in my new place when I come from that practice?

The team in my new company does not have a code review process. I come from companies with code review as a must culture and thus I don't feel comfortable committing my code without having it ...
4
votes
1answer
107 views

Pair programming via mailing list

I've started work on a large, open-source project recently. This project uses a mailing list for development, thus all patches must be mailed to this mailing list. This marks a change from my previous ...
4
votes
6answers
1k views

Explicitly define enum values, even if the default value is the same?

There are times when an enum's values are important: it is not necessary for them to be unique, they also need to have specific values. In such cases, should the values be explicitly defined, even if ...
1
vote
1answer
117 views

How to keep class parameters visible while using generic argument passing

After writing some classes where class initialization requires multiple options, instead of writing several parameters into constructors or setters, I started passing an associative array of ...
0
votes
1answer
290 views

How often to open pull requests [closed]

We are planning to use Git pull requests for code review in our company. Before we start I have a basic question: How often should I open a pull request? Is it best to open one for every little commit ...
1
vote
1answer
140 views

Where to audit a codebase for dangerous code use [closed]

Not sure Programmers Stack Exchange is the place to ask this question, but thought I'd give it a go. Our team had a near miss recently with a nasty error where a method call had been added to the ...
61
votes
4answers
6k views

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 ...
4
votes
4answers
1k views

In Agile, should I create a code-review task?

My team uses Agile as a development approach. Currently, each task has four states which are todo, in progress, testing, and done. We've just started doing code reviews, and I wonder if I need to ...
1
vote
3answers
708 views

Should we enforce code style in our large codebase? [duplicate]

By "code style" I mean 2 things: Style, eg. // bad if(foo){ ... } // good if (foo) { ... } Conventions and idiomaticity, where two ways of writing the same thing are functionally equivalent, but ...
3
votes
3answers
296 views

What is the appropriate amount of guidance and mentorship a junior programmer should receive? [closed]

I'm a junior software developer, and just got this job working with a very small group of engineers. I've been coding for a few months in this group in a professional settings - before I just coded at ...