During the christmas-holidays I have coded “Silvertyper” a small Silverlight remake of the old dutch Commodore 64 game “Tempo Typen” in under 10Kb of source code for the 10K Smart Coding Challenge. Please vote for me if you like it!
This challenge reminds me very much of the old days when the size of your code really mattered. Note that when you start an empty Silverlight project in Visual Studio 2008 the size is already 6Kb!
Here are some tips to make your code a lot smaller:
- Put all your code in one file to avoid extra “using” statements
- Get rid of all comments and “private” and “this” keywords because you don’t need them this time!
- Use refactoring to rename your variables and methods to one letter names
- For this challenge you don’t need to put new lines, tabs and spaces in your C# and XAML code
- Use foreach when iterating through collections
- Clean up the generated code from Visual Studio