I’ve always been a big fan of peer reviews. I enjoy both giving them and receiving them. However, I find there is generally a developer resistance to them. Which is unfortunate. I hate reposting what someone else has already written, but I think Jeff Atwood really hit this right on the nose: Who’s Your Coding Buddy?. I think with a decent unit testing framework combined with code reviews, it should be possible to deliver software virtually defect free.
Archive for February, 2009
debugging code
Posted by kevinup on February 23, 2009
I was helping another developer debug some code the other day. We had an if statement, that when it was true, it should throw an exception. The problem was the exception was being throw every time even when we knew the expression should have been evaluated to false. I had to laugh when I saw the code and realized what was going on.
bool some_expression_that_evaluates_false = false;
if (some_expression_that_evaluates_false);<-------------
{
Console.WriteLine("Why is this code executing?");
throw new Exception();
}
Posted in Uncategorized | Leave a Comment »
Central Ohio Day of .NET
Posted by kevinup on February 17, 2009
Posted in .net, ASP.net, C#, javascript, performance, tdd, web development | Leave a Comment »
Changing Priority
Posted by kevinup on February 3, 2009
So a while ago my client gave me new requirement that went something like this:
It has to be fast, really, really, really, fast. And did I mention it has to be fast? Oh almost forgot, it has to go fast.
Well, I coded it up, was pleased and moved on. This week our QA server was having some problems. It would slow down, and then suddenly be responsive again. Apparently the testers had finally gotten around to testing my little piece of functionality. The head architect came to me saying that everything was running slow on the box. My code was basically spawning a bunch of threads, doing a bunch of work, and then closing out. This was causing the processor to peak at 99%, which is apparently a problem J.
Part of me was a little proud of my code. In hindsight I should have asked more questions about how fast it needs to run in.
Anyway, with the following code, it still was able to run pretty quick, without doing any major refactoring:
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal;
Posted in .net, C#, performance | Leave a Comment »

