August 2009
3 posts
My cool code snippet
I submitted this to the Resharper cool code snippet competition and thought I would share it with everyone else, including why it’s cool! [Test] public void $METHOD$_$SCENARIO$_$EXPECTATION$() { $END$ } I’ve been doing a lot of TDD lately and I am constantly writing new tests. So my number one snippet is one that creates a simple test. I’ve tweaked this template a lot,...
Aug 22nd
8 notes
Outlook 2010 + Google Cal Sync hack
So yeah Google Cal Sync doesn’t work with Outlook 2010 Preview, but I found a way to get it to jive. I edited Outlook.exe in C:\Program Files\Microsoft Office\Office14 using Notepad++ with the Hex-Editor plugin. At assembly location 0x000c09b2, I changed the value to 0x32, in the ascii dump. It originally read (14.0.0 and now reads (12.0.0 Good luck, I have no idea what this might...
Aug 6th
9 notes
“If you are doing custom Linq to Sql mappings, it currently doesn’t support...”
Aug 4th
1 note
July 2009
3 posts
2 tags
NUnit 2.5.1 framework with Silverlight 3
We’re doing some Silverlight development at work and I’m doing some off to the side. I like to stick with a familiar, proven unit test framework. NUnit 2.5.1. has some great new attributes to use during testing (actually these came out in 2.5) such as Timeout and MaxTime. To take advantage of them you have to have a version of NUnit compiled as a silverlight library or at least...
Jul 31st
21 notes
“Not using a ubiquitous language when developing an application is incurring yet...”
– Me
Jul 26th
Null Object Pattern
Code reuse is very important for developers, most of the patterns and refactorings exist soley to reduce the smell of duplicated code. Null checks are one of the biggest culprits of duplicated code. It is also, to a degree, a concern that often gets scattered through out an application and isn’t properly separated. Without testing and/or good documentation, it’s often hard to...
Jul 21st
June 2009
4 posts
“Program to an interface, not to an implementation”
– Not sure if this has a source, but it’s a great concept.
Jun 20th
2 tags
Refactoring - Compose Method
This refactoring, again from Refactoring to Patterns, reduces ambiguity in methods that have too much detail or conditional logic to quickly comprehend. By breaking a method down into smaller methods, the ambiguity can be removed. The mechanics of this refactoring are rather subjective, but obviously lead to the use of Extract Method. Study the code and make sure you understand it, the longer...
Jun 18th
2 tags
Chain Constructors
Chain Constructors is another refactoring from the book Refactoring to Patterns, it helps remove duplication in constructor overloads. This should be a very familiar refactoring for most developers. Catch all constructors are produced, and hopefully minimized, that other constructors rely on either directly or indirectly. Mechanics Study the constructors in the class and find the two with the...
Jun 18th
2 tags
Refactoring, Creation Methods
Lately, I’ve been engulfed in several design books, one of which is Refactoring to Patterns by Joshua Kerievsky. The book is an extension of Martin Fowler’s book, Refactoring. It emphasizes learning to use patterns by working with existing code, identifying code that “smells” and then finding a pattern to refactor the code “to, towards or away from.” Smelly...
Jun 17th