Thoughts on the MIX 10K challenge
For those that haven’t heard, Microsoft has announced an interesting contest in conjunction with the MIX09 conference in Las Vegas. The way the challenge works is that you need to create a program where the source code is less than 10K bytes (10240 bytes) in Silverlight or WPF XBAP that will run on the web.
Rules and details are here:
http://2009.visitmix.com/MIXtify/TenKGallery.aspx
These types of competitions have been going on pretty much since computers have been around, and in particular, the Demoscene has some great samples of tiny programs doing amazing things.
The prizes are pretty sweet, including a trip to MIX09, $1500 Visa gift cards, and $500 Visa gift cards.
So a few thoughts on how to cram something into 10K.
First of all, forget a lot of what you learned about good programming techniques. Unless you’re ultimately saving space by breaking something into multiple methods or classes, shove everything together.
Make your variables and methods a single character if possible. You can write using longer names and refactor->rename later if it’s easier.
Reduce whitespace. C# can be written as a single line for the entire file.
Make sure to use using statements to avoid having to specify the namespace, but remove any unused using statements from your source files.
Use the built in .Net framework provided classes whenever possible instead of writing your own.
Consider using F# which can often use less characters for the same logic.
For any graphics, determine whether it’s more efficient to represent it as XAML or a bitmap image. Also consider writing code to create the graphics if it’s less characters than the XAML equivalent.
Anyone else have good suggestions to add to this?