Finding files: Recursion vs Stack<>…FIGHT!

I was just poking around the Internet and came across a blog post highlighting a solution to a common problem: find all files matching a criteria (e.g. *.dll) from a folder and all its subfolders (e.g. c:\windows and all subdirectories). In this post, I compare the speed of two methods using code in C#.

The fastest SIN validator

The fastest implementation I’ve seen of a validator for a Canadian Social Insurance number is from hackcanada.
I’ve rewritten his JavaScript code here in C# with a few guard clauses at the top. Enjoy!
================================

private static bool ValidateSIN(string sin)
{
int dummy;
if (!Int32.TryParse(sin, out dummy)) return false;
[...]

Design Patterns Quick Reference

Jason McDonald has put together a cheatsheet of some Gang of Four design patterns.
I used to visit DoFactory’s patterns pages for all the patterns but now I have a sheet with all of them on a page.  Cool!

Adding 2 integers (32-bit)

A 32-bit signed integer has valid values ranging from−2,147,483,648 to +2,147,483,647.
So why do I always see sample code of an integer addition method written in C# like this: