code-review

The Purpose of Code Reviews

As a Manager ultimately responsible for hundreds of developers, I believe that code reviews are required to ensure:- That code produced is maintainable. That published programming conventions/standards are met. In my circumstance, they are not to verify operation or results, as formal testing will quickly determine that. The questio...

"How to do a code review?" or "How to tell a co-worker that her HTML sucks?"

I just started working for a small web company that has one designer and one programmer. I'm kind of the person in between with experience in both worlds. The problem I see right now is that the designer seems to be setting the standards, even though her practices are sometimes wrong (such as invalid html: wrapping block level elements ...

How should I print out a particular character in the file after reading the file?

Hi, I am reading a file using perl script. This file consists of strings with different characters and I am supposed to identify strings containing the character 'X'. I want to know how should I (1) print this string (containing 'X') and also (2) write this string to another file (3) count the number of 'X' characters in the whole file....

When To Comment Code (The Other "When")

Yesterday I was going through some code of mine which made no sense to me at first (written less than a month ago). When I understood it, I quickly added comments to avoid the exercise. This made me think that, had I commented on the code as I wrote it, my comments might not have helped a later "me" decipher the code. When in the code'...

What would be a good forum to ask for a "code-lookover"?

I have a big program (I think, this is my first real game, its a little over 800 lines), and while the code itself is error free, because of how I designed it (see below) its very messy and I'm guessing inefficient. So I'm wondering what sites/forums would be a good place to ask for someone to look it over and just point out to me any p...

Is there a windows tool that is compatible with the OS X text editor SubEthaEdit for collaborative coding?

...question says it all! Looking at tools for collaborative editing for a distributed and having uses SEE in the past I would love to go down that road (but it has to be cross-platform).... ...

Monitoring and bisecting changes of output of some commands ran on a source code repository

I'd like to know if there is some tool to monitor changes that a patch does to a project. I have a source code repository, and I'd like to do things like: see what a patch changes in (text) output of an arbitrary program, eg. compiler output, or testsuite output etc. when applied given a line in some of these outputs, I'd like to bise...

What does this mean?

This: typedef HRESULT (*PFN_HANDLE)(ClassName&); It's used like this: DWORD ClassName::Wait(PFN_HANDLE pfnh_foo) { while (!done) { waitCode = WaitForMultipleObjects(paramA, paramB, paramC, paramD) if (waitCode == WAIT_OBJECT_0) { pfnh_foo(*this); } else done; } return waitCode; } It appears th...

Are design reviews useful once the code has been completed?

What is the point of reviewing a design document once the code is written? Hasn't the horse already left the barn? It seems to me that the design review should be skipped and more time spent on vetting the code. ...

What points should a code review check list have?

I am looking to prepare a code-review checklist which reviewers should be using in validating the code they are reviewing. I am mostly working in C/DSP/ARM assembly language code. Towards that I have thought of certain points which would go in that check list such as: No magic numbers. Pithy comments for every block of code which is re...

How to read information from file using regex and print it?

I am working with the following data: __DATA__ Branch 1: 10..11 13 E 0.496 -> Q 0.724 18 S 0.507 -> R 0.513 19 N 0.485 -> S 0.681 Branch 2: 11..12 81 R 0.891 -> Q 0.639 88 Y 0.987 -> S 0.836 From the above data, I want to read numbers present before a character and then print them out. So for instance ...

How to avoid lots of parameters in critical methods of my applications?

Hi. I tend to sucessfully write compact applications that can encapsulate many business logic in a simple and non-redundant way. I tend to create small methods, but over time I arrive to methods that have too many parameters. I know every code requires its design, but I see and antipattern in my behaviour and I am not sure which would be...

Optimising asp.net vb code behind

I have the below code.. i am finding a way to optimise it.. is there anyway to optimise it using findcontrol and loops ?? also eliminating headofficeSelected,areaSelected ,headofficeSelected and only using storeSelected ? If (storeSelected = 1) Then tempCollector = tempCollector + "<br>" + "Department" + ": " + txt_panview3_ddinpu...

Critique on jQuery Use

I'm busy introducing myself to jQuery by implementing a little system where onmouseover on an element causes a text balloon to pop up close to the element. I feel like I'm using too much vanilla JS here, so please suggest where I can improve and what is wrong with this code: <head runat="server"> <script type="text/javascript" src=...

How to improve this enumeration type ?

I will often need to translate from the string code into its Enum type. See snippet below. I think this is highly inefficient. How can I improve the method deref so that: It will be threadsafe. It is faster. Code: public enum SigninErrorCodes { InvalidUser("a0"), InvalidPassword("b5"), NoServerResponse("s2"); SigninErrorCod...

Best Code Review Tool for Large Userbase?

I am looking for a code review tool, which: Should support at least 6000 users. Have integration with GNATS Bug tracking tool. Should have a command-line interface to fetch review data using query. Should support Oracle Database. Should have web-base review feature. Good to have email-based review feature also. Do you have any sugges...

Please Review my JavaScript Code

I am a novice to intermediate JavaScript programmer. This is some of by best code. I'm not sure if this community is looking for stuff like this, but I'd be very interested to get some critiques on this JavaScript comment widget I wrote. I have a couple of mentors, but I can never get enough code review. It seems to improve my code by ...

Custom C# / .NET Code Analysis

What kind of a tool could examine source or assemblies and tell if StringBuilder was ever used? or if the ObjectDataSource was used? I'm open to source analysis or reflection, but also need to know the right way to do this against Web Applications. UPDATE: I guess I'm looking for a tool that you could insert into a build process that w...

Lisp: Elegant way to strip trailing nil's from a list? (Review)

I want to write a function that removes trailing nil's from a list. I first tried to write it elegantly with recursion, but ended up like this: (defun strip-tail (lst) (let ((last-item-pos (position-if-not #'null lst :from-end t))) (if last-item-pos (subseq lst 0 (1+ last-item-pos))))) ; Test cases. (assert (eq nil (strip-t...

Unit testing DAO, am I doing it right?

I'm starting out unit testing and reviewing Java web programming. The thing is I don't know if I'm doing things right. I'm building a mini blog. I'm using EasyMock for the mock objects. Here's my code: The test case The PostDAO The Post Bean I'd really appreciate your comments and suggestions on how I could improve my code and bec...