code-review

How does one deal with backdoor code changes?

Scenario I admit (somewhat shamefully) that I have not only witnessed this particular practise, but I have also committed it myself. My name is Jeff and I have gamed a quality process to get my way. The scenario I am referring to is this. Engineer A wants to do something a certain way but Engineer B has already implemented it. Rather t...

Looking for a regular expression to identify hard coded magic numbers in source code

A frequent issue in code reviews is whether a numeric value should be hard-coded in the code or not. Does anyone know of a nice regular expression that can catch 'magic numbers' in code like: int overDue = 30; Money fee = new Money(5.25D); without also getting a ton of false positives like for loop initialization code? for (int i = 0...

Tool to browse Multi-thread (C++/C) code ?

We are using multi-thread in our fairly large product, but when doing review we hardly know a function or method will run under which thread. I know this looks stupid, but in a large product without good modularization, we can lost. And there are many potential synchronization problems are aware of. So I'm wondering if there are tools f...

Code review policy example?

I was asked to author a formal code review policy document. It was to meet PCI requirements, but I have no idea what such a document might look like or include. Are there any examples of such a document? ...

How to get the FxCop custom dictionary to work?

How is it possible to get the FxCop custom dictionary to work correctly? I have tried adding words to be recognised to the file 'CustomDictionary.xml', which is kept in the same folder as the FxCop project file. This does not seem to work, as I still get the 'Identifiers should be spelled correctly' FxCop message, even after reloading ...

How is code review different from QA (quality assurance) reviews?

Can both be done at the same time? Besides the actual coder, who should participate? Should different people participate in one and not the other, or should it always be the the same participants in both? Just how should it be set-up between the two? ...

Who should do the Testing of software. Its the developer(who wrote it) or the tester(who just writes testcases)

I am a big fan of agile software development which include code-reviews,testing extensively. But my question who should be ACTUALLY TESTING the code. Is it the developer, who wrote it from scratch and who by the way writes test cases(just like me) for each feature he/she rolls out? Or a dedicated tester, who didn't touch(code) the featur...

Lazy loading and lazy execution patterns

I'd like to get some feedback on a class I wrote for encapsulating the lazy-load pattern. Usually, when I do lazy-loading, it looks something like this: private SomeClass _someProperty; public SomeClass SomeProperty { get { if(this._someProperty == null) { // run code to populate/instantiate _someProp...

Efficient Code Review

I would like to know how programmers do review of code written by others. I find myself bit sloppy in that respect. When ever a experienced programmer sends a request for reviewing code, I fail to be serious when going through the code just for the reason that I believe that he/she cannot be wrong. Most of the time I send back reply as '...

Code standards in agile teams with modern IDEs?

We're an agile project of about 20 developers organized in 2-3 teams, doing no pair programming, a little bit team rotation and a lot of peer reviews. Most of us are addicted to the "green status bar" of IDE code analysis (most of use idea, some eclipse and netbeans, resharper is idea functionality in the .net world). We are considering...

How good is "Best Kept Secrets of Peer Code Review" ?

You've seen the advert (except the original URL has gone AWOL): This is an image for the book from SmartBear (in lieu of the missing advert): Who's requested the book? (I have.) Who's read the book? (I've started.) What are your impressions? (Mine are favourable so far - but I'm not sure whether I'm going to learn anything stun...

SO Community code reviews?

I didn't see this in the official FAQ, and I'm rather new so I'm not sure of the community conventions. I am a IT guy trying to learn programming on my own. I don't have access to someone else to look at code that I've written, so I am curious if it is acceptable to the SO community to post code for review? For example, I'm working thr...

Where Can a Solo Developer Find Good Mentoring / Code Review Resources?

I recently read this post from several years ago about OR/M. Personally I'm a huge fan of object-relational mapping and in fact, I'm reading Fowler's PoEAA right now in hopes to better understand how to address the problem. But Jeff's post got me to wondering first what Jeff and apparently others know that I don't. I also recently stum...

Any Code Review Communities out there?

After reading this post I had a look around for 'code review' communities, but I did not really find one. There were a few but they were usually for a very specific technology and not just a programming language specific one. Never really thought of it before, but there sure is a lot of code out there that could benefit from a review. N...

Do you code review unit tests?

After reading this question I'm left wondering if shops doing code reviews bother to do the unit tests as well? At my current contract all code must be reviewed before commit, but historically unit tests have not been taken seriously. This is an area I'm addressing at the moment and was wondering if people would include the unit tests...

What problems are easy to spot in a dependency graph?

What are the things I should be looking for when I produce a dependency graph? Or to put it another way, what are the characteristics of a good looking graph vs a bad one? Edit: The context here is my first look at my assemblies in NDepend. ...

Code Review in Java?

I saw some questions similar but none answer this question. For performing java code reviews what do you often look at. Do you recommend books, articles, tools which impressed you most on it. ...

Could you please review my Quick Int Parser implementation?

I wrote some utility methods that can parse a 32-bit signed integer much faster than Int32.Parse. I hope you could give me some of your experience by reviewing my code and suggesting enhancements or pointing out bugs. If you are interested (and have the time of course), I would be very grateful. I have posted my code on the "Refactor My...

Does any tool similar to NDepend exist for unmanaged C++ code?

I have enjoyed the power of NDepend ( http://www.ndepend.com/ ) when writing C#, but in my C++ projects I have not found a comparable tool. I use Visual Studio 2005, which has a class-view that covers some bases, but it is not powerful enough and doesn't work across project boundaries. I use Visual Assist X, which has some powerful refa...

As our favorite imperative languages gain functional constructs, should loops be considered a code smell?

In allusion to Dare Obasanjo's impressions on Map, Reduce, Filter (Functional Programming in C# 3.0: How Map/Reduce/Filter can Rock your World) "With these three building blocks, you could replace the majority of the procedural for loops in your application with a single line of code. C# 3.0 doesn't just stop there." Should we increasin...