What are the crappy code games - the background?
This is part of a series on the Crappy Code Games
- The background
- Who can enter?
- What are the challenges?
- What are the prizes?
- Why should I attend?
- Tips on how to win
The Background
Fusion IO came to us a while back wanting to run a competition to highlight the how bad code can really impact your system. We’ve all seen it, I saw an example yesterday where someone had implemented a cursor on a whole table just to update a few rows, something like this.
declare cUpdateCursor cursor for
select CustomerId, DateOfBirth
from Customer
declare @CustomerId int, @DateOfBirth date
open cUpdateCursor
fetch cUpdateCursor into @CustomerId, @dateOfBirth
while @@fetch_status =0
begin
if datepart (dayOfYear,@dateOfBirth) = datepart(dayOfYear,getdate())
update Customer
set Age = Age +1
where CustomerId = @CustomerId
fetch cUpdateCursor into @CustomerId, @dateOfBirth
end
Clearly this code is far from efficient and code be replaced by
update Customer
set Age = Age + 1
where datepart (dayOfYear,@dateOfBirth) = datepart(dayOfYear,getdate())
A little simpler I am sure you will agree, and it is likely to perform better.
There’s no such thing as a crappy scale
The challenge we faced was trying to test how bad someone’s code really was. There isn’t a crappy scale that I’m aware of.
Most performance issues in my experience are due to performance of the storage and queries reading too much data. So we flipped the idea on its head and came up with the idea of a set of games where you have to get as much out of the storage as possible. The maximum number of reads, writes etc.
You will get a virtual machine where you will run your code and the results measured. You will be running against other people in a set of heats and the winners will go to SQLBits in Brighton for the final and the chance of big prizes.
The events are to be held as follows
Manchester - Revolution Bar, Deansgate Locks, March 17th, 6:30-11pm
London - Revolution Bar, Tower Hill, March 31st, 6:30-11pm
Brighton - Grand Hotel, April 7th, 6:30-11pm.
Hope to see you there
- The background
- Who can enter?
- What are the challenges?
- What are the prizes?
- Why should I attend?
- Tips on how to win
You can find the details of the events and Terms and Conditions here
To register/enter the games go to http://www.crappycodegames.com/enterCompetition.php