views:

306

answers:

11

I've had an epic google on this topic and also looked long and hard through the suggested answers to this quandary so please I just want some concrete advice if such exists. Here's my situation. I work as the sole developer at a very small company, my boss used to hack a bit of classic ASP but no longer uses and thus has lost most of his technical skills.

We're looking into tightening up our coding and deployment practices and code review seems like a must. The only problem is that a traditional code review process is absolutely impossible under the circumstances. So what kind of mitigating processes might one try out to go through code before one presses the commit button on source control which don't require a review session with peers.

Personally I'm so far coming up empty but I guess this is time to innovate so go nuts.

+3  A: 

Maybe it's obvious, but I always look hard at the diff before committing and ensure each modification does what I thought it did when I wrote it.

Amnon
that's a good practice in general, but I find that commits are done to soon after the code is written for me to be able to review them with a fresh mind.
Nathan Fellman
A: 

If you have skilled friends you can trust you might want to bounce your ideas off them, to make sure you are not doing anything foolish architecturally.

I find heavy unit testing is helpful too.

hvgotcodes
+1  A: 

I asked about code review communities and got some good answers, such as:

willcodejavaforfood
+2  A: 

It's hard, but at least, you could wait for a few hours, so your mind may rest, and be able to think a little bit more objective.

So, you may end your day, go to sleep and the next day perform your own code review, trying to spot weak points. Probably with the sleep hours, you mind may criticize your self better.

OscarRyz
+6  A: 

You're missing a crucial aspect of code review: another coder.

Seems like a good way to get around this would be to find a way to look at your code with "fresh eyes." Set up a schedule to revisit code you've "completed" and look at it again to see if you can (a) understand what you did and (b) improve on it.

This admittedly takes discipline (that I get only occasionally) but without someone else to catch things you've missed I don't see any other way around it short of posting things here that you suspect might need attention.

John at CashCommons
A: 

Do you have a continuous integration environment and build-time quality checking tools?

I'd suggest give your circumstances that code reviewing would be more of a problem than a benefit.

CI + Code quality automation and decent test coverage may be a much better alternative.

dannywartnaby
+11  A: 

This seems like the perfect opportunity to use Test Driven Development. Done correctly, this will tend to make you look at the process of creating code from both sides; the result and the routine.

KevinDTimm
I think this is a good answer. I also agree with John @ CashCommons below that it is important to have another person look at your material.
Brian Stinar
A: 

It's true that it's less than ideal to review your own code, but I've found that code that I wrote just a few weeks ago is almost as foreign to me as code written by other team members.

The facts that (a) I don't always remember the exact reasons I wrote code the way I did and (b) I am constantly learning, so (I hope) I am a better coder now than I was a while ago, both give me the ability to look at my own code critically.

If you've been working on the code for a non-trivial amount of time, a self-review of your code should be almost as effective as a peer-review.

Nathan Fellman
A: 

By not describing your development environment, it looks like you want someone to describe a code review at a high level.

I find that after code has been written and as a part of "white-box-testing", I run my code through a debugger to follow the logic.

Unfortunately, more than one set of eyes is needed for a good code review. So, go through your logic on paper first as one set of eyes. Wait a while (overnight?), then go through the code again in a debugger as another set of eyes.

Hopefully your language of choice provides a good code coverage tool of some kind.

sorton9999
A: 

You could always still code review with your boss. It will be slow, since you'll have to do more explaining to him, but I find that the act of trying to explain code to someone who has no clue what it's doing forces me to look at it from a perspective other than mine.

Getting a forced fresh perspective can really help.

alesplin
Y'know something having a sounding board is often ideal. I think my boss's head might actually explode if I demand his time to explain something he only half-understands to him for my benefit. It's a good idea from my point of view though.
bert
the point isn't to describe in minute detail (creating exploding boss head) - the point is that your own thoughts will often become more clear to you when you elucidate them to someone else - even a pet can be helpful here (really - it's the talking, not the listening - that can solve the problem)
KevinDTimm
The exploding boss head comes from me taking up any time with my stuff that doesn't really relate to his stuff. Y'know a philosophy that says taking care of the code is what I'm paid to do. If he has to think about it at all that's a net loss of time for him...
bert
+1  A: 

Been there done that many times. Here is one thing to do : find a good, competent development shop in the area and pay them the [INSERT HOURLY FEE] to take the code and review it.

Another trick is to minimize the need for reviews by using lots of team oriented tools. Especially TDD and continuous integration. The automated testing and building really enforce discipline.

Wyatt Barnett
If you have the budget and having code reviews is important enough, this is a good idea, companies I work with have done this in the past (outsourcing code reviews to an expert in the specified field) and for the cost of 3-4 hours (depending on the size of the codebase) you can get some great, valuable feedback.
Guy Starbuck