Building a site – Part 3

Continuing Development as life happens

It is challenging to maintain momentum on a side project with Christmas, Snowboarding, work, TV and many other things going on. Those combined with a 3 week coding break almost killed my side project. Luckily I persevered and there’s something, albeit something very small, to show for it!

Even on a small project, there ends up being a fair bit of refactoring.  My initial attempt at DDD did not work well at all. It was very artificial and was difficult to integrate with the 3 distinct threads in the application. DDD is easily applied in an n-tiered stack with a single thread or on a web stack where it appears there’s a single thread, but on a moderately complex, multi-threaded environment it is very unnatural. Eventually I decided on a model with classes given appropriate component names. I also discovered a better way to detect what end users are doing – Global Event hooks is bad – GetLastInputInfo() is good. This was a core part of the application and combined with the DDD changes, the client code was almost completely re-done.

I feel as though I got lucky on the client side. My first attempt at the UI used Twitter Bootstrap  and that’s basically what you see today. It was a life saver really. I spent zero time on CSS, and only minimal time laying out the site using Bootstraps scaffolding. I definitely will use Bootstrap for future projects. If it was a professional project, I would need to invest time in customizing the CSS – since this is just for fun, the default looks great imo.

The project had several “very bad bugs”. For some time, the charts simply didn’t reflect what I had actually done! They kinda resembled what had happened, but it was easy to see they didn’t make sense – the application was completely useless even though it was correctly logging and displaying information. Somehow what you see was not correct. Debugging what was wrong with an ASP.NET MVC site hosted in Azure talking to Azure Table Service gave me considerable headache initially. After, I discovered that all it takes is a firewall rule in Azure and you can step through code as usual, everything was simple.

Unit tests would have saved me incalculable amounts of time. I think all my really bad bugs would have been solved with proper testing. I had the attitude on this project that “I don’t need to write unit tests- thats’ a waste of time. My code is well-written. It could have unit tests written against it! – that’s good enough”.

This entry was posted in .Net, Architecture, C# and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s