Shipping Software - A response to Joel Spolsky

Joel recently posted The Duct Tape Programmer which has received an enormous amount of buzz, both positive and negative. At work, I received emails telling me that the article is a must read, while receiving different emails flaming Joel. If you haven’t read it, I highly encourage you to do so. In short, it is about shipping software above all else. I have spent the evening catching up on blogs, many of which are just responses to Joel’s, so I felt I should jump on the bandwagon. »

Powershell script to Register Visual Studio Schemas

I always have to Google how to add an XML schema to Visual Studio because I forget the directory (even though it is super easy). Never again will I forget. function register-vsschemas() { begin { $schema_folders = gci $env:ProgramFiles -Filter "Microsoft Visual Studio*" | gci -Filter "Xml" | gci -Filter "Schemas" } process { if(!$_ -or !(Test-Path $_)) { Write-Error "File '$_' not found" break; } if((gi $_).Extension -ine ".xsd") { Write-Warning "File $_ does not end in an .xsd extension" } foreach($folder in $schema_folders){ #It is very interesting I had to use .FullName... »

PSDefaultVariablizer - I didn't know what else to name it!

public class PSDefaultVariablizer where T: class { string variableName; T innerValue; PSCmdlet cmdlet; public PSDefaultVariablizer(string _variableName, PSCmdlet _cmdlet) : this(_variableName, null, _cmdlet) { } public PSDefaultVariablizer(string _variableName, T _innerValue, PSCmdlet _cmdlet) { variableName = _variableName; innerValue = _innerValue; cmdlet = _cmdlet; } public T Value { get { if(innerValue != null) { return innerValue; } else { return (T)cmdlet.SessionState.PSVariable.GetValue(variableName, null); } } set { innerValue = value; } } } Here is the use case for the class. »

A night of firsts: VS2010, Dynamics, Python

Tonight, I installed Visual Studio 2010 beta 1 for the first time. I know I am late to the game, but I had to give it a whirl since I found some free time this afternoon. One feature of .NET 4.0 I wanted to try out was the dynamic keyword with Python scripting. So, here is my first hello world program using dynamic, with the help of this walk-through. class HelloWorldDemo: def run(self): return "hello world" Here is the C# code needed to run it. »

Death of SQL Injection, long live SQL Injection

I very rarely hear people talking about SQL injection anymore. Just a few years ago, it was a very common problem that all developers needed to understand, in and out. My guess is, the prevalence of database abstraction layers in all languages have helped remove this problem from most developers minds. Hibernate, ActiveRecord, Zend_DB, and all the other frameworks in nearly every language are used much more than hand-written queries. The death of SQL injection. »

TDD with Powershell, from the client perspective

Is it possible? Yes, and it is actually relatively easy. The hardest part can be figuring out how to mock/stub out certain functionality so your testing small units as opposed to full acceptance testing. The line can get blurry, but I don’t really care. Testing is half the battle. But to be clear, the focus of my testing is to test how a snap-in is working. It sounds like an integration test, and maybe it is, but there is no reason you couldn’t test any powershell script using some of the steps outlined here. »

DateTime.ParseExact()

Today I used this function for the first time. Somehow, I have never needed this before. It is super simple and very useful though. It is basically the inverse of DateTime.ToString(“yyyy-mm-dd”). It allows you to parse a custom date/time format. So, for example a Pound proxy log has a date in the format 12/Mar/2009:05:00:36 -0400, which isn’t a standard format in .NET. Using ParseExact, parsing it was a piece of cake. »

What are your developers talking about?

I found myself in the middle of an argument over the differences between static and global variables today. I started to give my input, and stopped dead in my tracks. I don’t care what the answer is. I love the fact that my developers enjoy programming enough to argue about the semantics of it. I love that they take software development so seriously. I love that they want to know the answer. »

Database integration testing, Interested?

Testing database queries is super important, but not easy enough. It can be done, but usually you have to write custom test fixtures and spend too much time doing it. Every project needs to test database integration, so why isn’t there a library out there to make it easier? NDbUnit seems somewhat dead, and only works on a specific set of database providers. Even worse, it relies on a ton of XML setup, which I hate. »

Superbowl Weekend - Uncle Bob vs. Joel

This is the weekend when titans collide. Where everything is put on the line. Where Uncle Bob challenges Joel to a post-off. Today on Object Mentor, Uncle Bob railed Joel Spolsky and Jeff Atwood for their recent Stack Overflow Podcast. Whose side am I on? Well, if it’s on SOLID principles, Agile, testing, or anything to do with code, Bob. »