code-review

Global Code Review

I have some developers who are rather green when it comes to object oriented development, and I was looking for a way to explain to him the concept of casting and a few other things. I was doing a code review on some of his code and I find things like protected Guid LastValue { get { if (ViewState["LastValue"] == n...

What is the most constructive way to code-review an interview submission?

As part of our interview process, we ask candidates to complete a coding problem of moderate complexity. Some candidates seem to spend an awful long time on it and produce code that is not of high enough quality. It can be difficult to document what "high enough quality" actually is and provide feedback that is as useful and objective a...

Code Review: ADO.NET Data Access Utility Class (VB)

When I started at my current employer I inherited a project from a previous developer and in that project was a data access utility class that tries to simplify a lot of the code involved in making calls and retrieving data back from the database. Over time it has been modified to add more overloaded forms of functions, and now I am look...

code to change file extension (up for review)

I am using the following piece of C code to change file extension. { #define EVAL_MAX_LEN (300) int nLen; char szOut [EVAL_MAX_LEN] = {0}; char szPath [EVAL_MAX_LEN] = "/db/file/face.bmp"; // Get string length !!! nLen = strlen (szPath); if ((nLen > 0) && (nLen < EVAL_MAX_LEN)) { while (nLen) { // Check for...

Does malloc() allocate a contiguous block of memory?

I have a piece of code written by a very old school programmer :-) . it goes something like this typedef struct ts_request { ts_request_buffer_header_def header; char package[1]; } ts_request_def; ts_request_buffer_def* request_buffer = malloc(sizeof(ts_request_def) + (2 * 1024 * 1024)); the programm...

nullable types: best way to check for null or zero in c#

i'm working on a project where i find i'm checking for the following in many, many places: if(item.Rate == 0 || item.Rate == null) { } more as a curiousity than anything, what's the best way to check for both cases? I've added a helper method which is: public static bool nz(object obj) { var parsedInt = 0; var parsed = int.Try...

Seeking Humility: Are there any websites that will do code reviews for you? Looking for my WTFs per minute...

Are there any websites that you can submit code for peer review (or review other peoples code)? Duplicate of Online Peer Code Review? ...

How could this be better?

Edit: This application searches in a Sql Server 2000 data base not in a flat file, the flat file only contains the serial numbers that I should look for them in my SQL Server DB table (i.e. the flat file lines will be used as parameters for the where clause only). Hope if it's clearer now! I'm working on .NET windows application that ...

What do you think of my simple Java class that encrypts text into SHA-1?

Anyway I'm starting out to make Java programs (a programming newb) and I've decide to do a simple utility class that converts text into SHA-1 strings. I'm planning on using this to encrypt passwords for databases. Feel free to comment and I'd love to learn from you guys. Here's my code: /* * Utility class that encrypts a string created...

How do you review large blocks of new code

I'm a strong advocate of code reviews, whatever that means. I know it means different things to different individuals and groups and can be applied differently in different phases of development. When I make a one-line change to a #define to fix a typo in a user-visible prompt string, "Hey, Joe, did I spell 'FooBar' right?" is easy. ...

Need to override method that is in a namspace with another class which constructs it

Hello, I am trying to override a method on a control in the Community Server SDK called 'InlineTagsContainerTagEditor'. When I find the source for this control, it is inside of a file with another class called 'TaggableContentTagEditableList'. Here is what I think the relevant parts are: namespace CommunityServer.Controls { publi...

what is your code review format/ good code review webcasts?

Just watching a great video on a code review of the unit tests of an ASP.MVC project and it I found it fascinating in how his approach is different to mine. Are there any other good video resources on this? and what format does your code review take? ...

internal code review tool for web developers? Both for security and QC.

I feel fortunate that I have been given an opportunity to improve code practices in my office by starting to implement some internal code reviews which could start out as some simple checklist. I need suggestions on tools and general tips. I went to school for SoftE and understand the process of classic software development. I then wo...

Is there a way to use review board with git without manually uploading diffs through the web interface every time?

I know review board is open source and I could modify the code myself, but I'm wondering if there is an easier way. By "review board", I mean the web-based diff review tool that lives here: http://www.review-board.org/ ...

Viewing unified diff with meld/vimdiff other tools

Hi, I've got a unified diff file (say my_diff.diff), containing comparison of several files from a project. What would be the best way to review all the code changes in a nice visual format, for example, using meld or vimdiff? I have figured out the way how to do it for a single diff file (ie. containing comparison of just two files)...

What is the best way to do code reviews as part of your development process?

What is the best way to set up a code review process as part of your overall development process? Can you share some thoughts/experiences on successful or failed code review processes that you have set up or been involved in? Some specific questions: Who reviews the code? Should it be a subset of your developers (for whom code revi...

Is it necesary to document your Code Reviews?

Hi all I have never even thought about this, but some people seem to be documenting the code reviews, by documenting I mean keeping a log of what the problems were, which files to change, etc. Personally I think is a not a great idea because it makes it way less dynamic and I would be afraid it could be used improperly, what are the vie...

using tab or spaces (indentation for code)

Duplicate of Are spaces preferred over tabs for indentation and almost certainly others For a long time the coding rules and guidelines in my company recommended usage of tabs (of size 4) over spaces (to save valuable storage space), initially I found it tough when I started working for my company, in the long run I got used to it. Now ...

Telling quality of source code from its shape

This is a jigsaw piece I am maintaining (bonus: green = commented response.write used for debugging) So I am wondering, what kind of shape do good code tend to have? ...

How to make reviewer interested in high quality code review?

I experienced to work with the code which was reviewed, but still of low quality. Actually reviewer looked through the code and could think that this is more formal procedure and didn't pay enough attention to the process of review and said: "I have reviewed the code!". Some small fixes can be made but significant flaws are missed. The ...