Nick Berardi has just written a great post ASP.NET MVC vs. ASP.NET Web Forms that compares the pros and cons of using Web Forms or MVC when developing a web application with ASP.NET. The part that I like most about this blog post is the worksheet scoring system that he's created to provide an objective way of choosing between the two.
Thursday, December 25, 2008
At the time of writing this (9am on Christmas day) I'd finished the project and checked the file sizes. 21,438 bytes - about double what I'm aloud. I'm now going to remove all comments, spaces etc. and refactor all variables down to a couple of letters each.
During the exercise of reducing the code size I did a number of things:
- I refactored my code. I went through everything I had written and found fragments of unused or unnecessary code and removed them. I also discovered all sorts of size inefficiencies in what I'd done and during this process reduced the code size, made it more maintainable and in the process faster. This came as a bit of a surprise because I didn't realize how much of an improvement refactoring would make to my code and as an exercise has opened my eyes to doing this more often.
- I used VS2008's refactor feature to rename variables and function names to single and two letter names.
- In the XAML files I considered each attribute and if I was explicitly declaring the default value then I removed it. This had probably happened when I changed from the default to a specific value and then back again.
- In all files I removed newlines, replaced tabs with spaces and then replaced double spaces with single spaces. The last operation (replacing double spaces with single spaces) needed to be run four to five times to remove all the redundant spaces.
In the end I managed to reduce the code to 9,617 bytes. I also learned a ton about Silverlight in the process, especially how little code is really needed in the App.xaml and App.xaml.cs files.
There was another feature that I wanted to put into this calculator which I'd left out because I suspected that it wouldn't have fitted in. With hindsight that appears to have been the correct decision as I don't think the remaining few hundred bytes would have been sufficient space.
Links to posts about the Mix 09 TenK Challenge:
Sunday, December 14, 2008
Oxite is a "simple blog engine written using ASP.NET MVC."
At the time of writing this I am hosting this blog using Grafitti CMS. If I was about to start this blog I would select Oxite because:
- It uses ASP.NET MVC which I'm familiar with and have done some work on.
- It's open source so I can change it easily to suit my needs.
The pain points in moving to Oxite would be:
- Converting the blog content and comments to Oxite, data store and format.
- Writing link redirection to preserve page rank and avoid broken links.
Friday, December 12, 2008
I've just upgraded the Silverlight Toolkit libraries that I'm using to the December 2008 version.
When reocmpilling my Online Calculators project I discovered that the DynamicSeries type had disappeared but it wasn't listed in the changes section so I had to hunt around for it. I compiled the Toolkit's source and then searched all the files for DynamicSeries and found it left in one of the comments and it appears to have been replaced by the DataPointSeries class.
Replacing the DynamicSeries references with DataPointSeries references got the project to compile and it appears to run correctly.
There has, however been a performance degredation in the auto-updating of the charts in the Mortgage Calculator so I haven't deployed this yet. I'll try and take a look at what's happening and try and optimize my code and see if I can get it back to the current speed before deploying the new libraries.
Wednesday, December 10, 2008
Friday, December 5, 2008
A collection of resources that I've found useful while learning Silverlight 2.
Silverlight Spy - Silverlight control inspector
Monday, December 1, 2008
I've finally had a chance to do a bit of work on coming up to speed with Silverlight and thought I'd share my findings and get some feedback.
I've created a Calculator site with a couple (so far) of pages written in Silverlight:
Findings from my point of view and my skill set:
Advantages of Silverlight
- Language is C# so zero learning curve on that part.
- Tools (VS2008 and Blend) are very good - Intellisense made the learning curve less steep for the Silverlight library, architecture and controls.
- Web resources good - I hit plenty of small problems (like hosting this on Server 2003) but after a bit of searching found answers to all problems.
Disadvantages of Silverlight
- So far I've only been able to get those pages to work in IE and Chrome and can't get them to work in Firefox.
- Opera is not supported yet.
- Not everyone will want to install the Silverlight plugin to view those pages.