code-review

How to get new Motivation after a bad code review

So i presented my code yesterday...after a lot of hard work i was happy to show it to my colleagues. After presentation all that was left was my projects name. Everything else has to change... They took a lot of time to explain their point of view but after getting back in my place i was really disappointed. I read mostly all "motivat...

How to train junior programmers in code review?

We're looking to start a code-review process for a group of ~30 coders who are all relatively junior programmers. What is your advice on how to train for code reviews? Are there code review pitfalls to be avoided? Essential things to look for? ...

help with my MARS MIPS Simulator Code

hey, i need help. I have written this code in MARS. It is supposed to receive an integer from the user, and convert it to HEX. I've been going over it for hours and as far as i can see, it should work fine. I have only included the loop and output part of the program as this is the only part that is not working. Can someone PLEASE point ...

Code review tools to work with SCCS?

Possible Duplicate: Best tools for code reviews Hi All, I want a code review tool , that is simple to use , nothing fancy and must be able to pull source or integrate with SCCS. Could be web based or a desktop client. I will be using this on linux. AIX would be preferable. Code i will be reviewing is perl, but that shouldn...

How to connect CodeStriker to FogBugz

I have just installed the CodeStriker code review tool. Has anyone attempted connecting it to FogBugz? In the CodeStriker documentation I saw it works with Scmbug, whichintegrates software configuration management (SCM) with bug-tracking. Has anyone connected Scmbug to FogBugz? ...

Code review conducted by an engineer who codes in a different language. Is it constructive?

I'm a Technical Support Engineer who recently discovered how fun programming can be. My boss noticed this interest and suggested that I learn Ruby as a first language since the company can benefit from it, it has a very elegant syntax, and we have no need for more Java/C/C++ programmers. Well I've written my first fairly large Ruby scri...

Tips to keep focused during code reviews

I often get sent to sites where I need to do a code review of a system I am not involved in, and once reviewed won't be involved in again. I spend time during the usual tool tests and looking for patterns but at some point you just need to read code. After the first 5000 or so lines it just becomes impossible to focus on the code, espe...

How to prevent (junior)developers making the wrong decisions/bad code?

Short of hovering over the developers and question all decisions they make/code they produce.. Architectural choices, massive codefiles (5k loc), no code commenting or documentation, .. I'm using some Check-in policies in TFS2005 like Changeset Comments Policy, WorkItems, regular code reviews. What works the best in your company? So ...

Recurrent if loop in a Switch

I would like to know if there is anyway I can do this without having to do the same If loop in each of the Switch cases since it's a bit repetitive. switch ($val) { case 1: if(!$object->doSomething1()==$goodValue) row .= $object->doSomething(); break; case 2: if(!$object->doSomething2()==$goodValue) row ...

How many hours of code review for each hour of development time, approximately?

We're trying to get a budget together for a new project. We would like to break out code review time separately. What's a good rule of thumb for how many hours of code review are required for each hour of software development? Ballpark estimates and anecdotes are fine. (Figure a 3 developer team on this one.) ...

Malicious Code Examples/Snippets

What is the best way to prevent introduction of malicious code when using snippets, skins, etc.? Obviously this is less of a problem with sites like StackOverflow; however, how often have you run into Malicious Code Snippets? I don't just mean careless or wrong. I mean actively malicious. For example, I have used Wordpress a lot late...

C#: Find all empty catch blocks

I am reviewing some code. I have notice some empty catch blocks. Not a good idea since somethings do not work and you cannot see why. Is there an easy way to find all empty try catch blocks in a solution? EDIT Thanks for all the answers. Used the example given by Stefan. Had to do a few variations, there are many ways of writing emp...

Request for code review: does such XmlSerializer factory have any drawbacks?

Hi! People tend to recommend to cache XmlSerializer instances. Is this still actual? (if no, when has it become so?). Also I came up with the following code and ask to review it. Does it have any drawbacks? Will it use many threads\cores for different types? How can I improve it? The code: public static class SerializerFactory<T> ...

Is there a site where I can post snippets of code for review?

I'd seen someone post a link to such a site on SO , but I forgot what it was... ...

What are the skills needed to read and understand other people's code?

Hi, I have got a new job, and in this job I need to go through other people's code to understand the application. What are the skills which I must acquire to accomplish the task of reading and understanding other people's code? What best-practices should I follow while reading and understanding other people's code? Which books or on...

Constructive Criticism

While peer programing what is the most optimal way to offer constructive criticism? How do you critique without pointing out flaws? ...

Finding all methods with missing security check

I am working on a code review. We have code that looks similar to this: public int MyMethod(Message message) { // Check that the user has the access to the function CheckUserHasAccessToFunction(UserName, FunctionName); // Do the work } What I am wondering is: Is it possible to find all methods whe...

PPV Code Review - Is it good idea?

I believe in (solo) code reviews a lot. But I am in a one-developer-shop now. I would like to have my code reviewed, and willing to pay money for it. Question: Is there a place where I can have my code reviewed for money? Note: I understand that most of us are willing to review some one else code for free, but there is a limit to h...

Model View Controller inside a Model View Controller

I've just recently completed a personal project and one technique I did use to break down the interface was to have one main Model View Controller that was handling a lot of the main logic of the application. Then for the most part, there were many generic controls lets say a Slider and a Text Field that were bound together to a single f...

Java: Finding matches between Strings

Given 2 strings, I want to find the first match of at least four characters. This is the code I currently have to do it. It works correctly, but I'm thinking there may be a better way to do this. Are there any screaming inefficiencies or bad practices in what I'm doing? Are there common libraries, like Apache Commons, that I should be t...