code-review

When reviewing somebody else's code, what is it that you usually find most disturbing?

When reviewing somebody else's code, what is it that you usually find most disturbing? ...

Proper way of storing RadioButton values in DB

Hi All, I need some suggestions on following code: Scenario: Its like a Opinion poll, You have to choose Yes/No and the data will be stored on DB.But I think this code can be optimized,can some body suggest proper way of doing this. <form id="form1" runat="server"> <div> <asp:radiobuttonlist id="RadioButtonList1" runat="server...

Open Source alternative to Mathworks Polyspace?

Anyone knows about an open source project (or maybe just free to use in commercial projects) that is an alternative to Mathworks Polyspace? I'm searching for tools for code checking and found some good alternatives for static checks, but PolySpace seems to offer so much more power. I think there's no real alternative out there, but may...

CodeReview: java Dates diff (in day resolution)

Hello folks, Please your opinion on the following code. I need to calculate the diff in days between 2 Date objects. It is assured that both Date objects are within the same TimeZone. public class DateUtils { public final static long DAY_TIME_IN_MILLIS = 24 * 60 * 60 * 1000; /** * Compare between 2 dates in day resolution. * * @r...

Where should code be stored prior to code review?

Disclaimer I don't do code review, so this question is purely of academic interest. I have seen plenty of posts on stackoverflow that advocates/requires code review before it is allowed into source control. If you do this, where do you store code the unreviewed code, and how do you deal with the issue where the developer has to update ...

Code review tool for VB 6.0

Hi is there any tool for Code riew that can used in VB 6.0 IDE ...

Scheduled Code Reviews?

Hi, On our team, we like doing code reviews but because a code review can happen at any time it is jarring when you're in the programming "zone" and get tapped to preform a review. You do the review, which is great, but then it takes you ten minutes before you get in the "zone" again. I was debating about how best to handle the needs o...

Is it legal to use Reflector to analyze binaries when the owner forbids a viewing of the source?

I've been commissioned to perform a review of an application. Company A buys software from Company B. The software crashes often and is not performant. Company A hires me to review software and to inform them if the software is sound. Company B forbids me from viewing (or having access to) their source code citing that they own the i...

How can I improve this markup and CSS to keep things simple and easy to work with?

I have the following markup that is used to produce a pop-up style mega-menu (the .column div is there to allow multiple columns within each popup, though the example below only has a single column)... <ul id="mainmenu"> <li class="mega"> <h2><a href="/">Menu 1</a></h2> <div class="submenu col1 leftmenu"> <div class=...

How to manage SqlDataReaders in a data access layer?

I am trying to get a better handle on decoupling my code, code reuse, etc. I'm tired of typing the below every time I want to read some rows: using(SqlConnection conn = new SqlConnection(myConnString)) { using(SqlCommand cmd = new SqlCommand(cmdTxt, conn)) { conn.Open(); using(SqlDataReader rdr = cmd.ExecuteReader()) {...

Why does my Perl script delete the contents of whole file when I try to edit the file?

I am running the following code to open a file (test) and edit(search and replace) it. Program seems to open the file but instead of replacing it deletes everything in the file. I am not sure why that is happening. Can anyone help me out here? #!use/bin/perl use strict; use warnings; my $line = $ARGV[0]; my $find = '\s{6}seqfile\s=\si...

How to input different file names in string that needs to be replaced?

I am trying to read a directory which consists of hundreds of files. For every file in the directory, I am supposed to access(edit) an another file and replace a particular string 'information=filename' in that file by file names 'information=' present in '/home/test/test_these_files' directory. This is followed by executing the file '/h...

Developer Collaboration Reality Check

Distributed Teams = Fact Collaboration Infrastructure = SVN/CVS/HG + Ticket/Req-System + Wiki + Forum + Mailing List + xyz This collaboration is more or less offline, the individual developers can work independent of time and location. But how you collaborate in real-time on a code level, eg. code review ? I asked recently for a speci...

Where to put these code in a Rails web application?

I have some code that may just need to be called on a lot of places in the controller and model, where do I put these code in ? And how to call those methods then ? Thanks def self.number_of_months(start_date,to_date) # Get how many months you want to view from the start months (to_date.month - start_date.month) + (to_date.year - ...

Trac: code review plugin

I'm looking for a code review plugin for our trac installation. I found these two as the top result for "trac code review" query on google PeerCodeReview CodeReview I'm leaning towards PeerCodeReview plugin. Requesting the SO community for inputs about these plugins to help me select the one for our trac installation. If you kn...

How to avoid politics in code reviews?

So I am trying to introduce code review to my teams. But a considerable number of peers fear that the political aspect might ruin the otherwise good teamwork. Have you encountered politics problems when you do code review? If so, how do you avoid it? Or more precisely, how to do a proper code review so there's least politics involved? ...

Can I avoid an unnecessary variable being created in this function?

I have got a very simple function that takes anything in as an object, but generally a string, and attempts to format it in a specific date format that we use for reports at work. The function is generally called using the OnRowDataBound event of a GridView and returns the date as a string if it could parse it or the original input as a...

Are there any design patterns to eliminate "my program is really just a big loop"?

I am often tasked with processing a list of tasks. Usually, this requires me to go fetch something programmatically and store it somewhere (database, file share, ftp, etc). Then I have to process the text file, xml, sql result set, or whatever it is, and store my results. For example: I have a database that details a list of a bunch o...

How to write Tetris in Scala? (code review)

Today's the 25th birthday of Tetris. I believe writing Tetris clone is one of the best ways to familiarize oneself to a new language or a platform. It's not completely trivial and it lends itself well to learning language specific constructs like iterators and closures. I've been hearing about Scala, and finally decided to read some doc...

Private Shared Variables vs Local Variables / Namespace Pollution vs Performance?

Reviewing code, I came across a number of new Private Shared variables (of type Hashtables(Of String), initialized in the declaration) added to a partial class for a very large (DataContext-derived) class. This seems sensible to me in one sense because they never change, and making these shared variables ensures that they won't get re-i...