What Do Programmers Really Do Anyway? (aka Part 2 of the Yardstick saga)

Way back in 2002 when we started working on Whidbey, I captured my thoughts on the direction we should take for C# and Visual Studio in two large emails. In the first email The Yardstick I spent a lot of time saying that you must evaluate features against the amount of time they save versus the…

30

What Makes a Good Programmer?

I just read two salon articles about Scott Rosenberg’s new book Dreaming in Code. His thesis is that “programing is hard” and uses the experiences of the development of the Chandler project to frame the discussion. Scott identifies a common problem in large software development – inconsistent terminology use across the software development team. At the…

20

C# Stumper: Why does this code not compile?

Hey folks, First off, I want to appologize for not having any activity on my blog for a while. I just got back from a wonderful 3 week vacation in Spain. Now that I’m back, rested and limber, here’s a twisted peice of C# code which is gauranteed to turn your brain inside out. Why does…

17

Many Questions: Switch On Enum

Just a quick one this week:    Why is it that you cannot use enum constants in a switch statement’s cases without first casting them to type int?   Often you will want to use Enum constants as case labels in switch statements. Sometimes, the compiler will complain and require a cast to int on…

16

Many Questions: switch on type

I hope everyone had a good fourth of July weekend. I certainly did. I spent the weekend hiking around the Olympic peninsula with my girlfriend and capped it off watching the fireworks here in Seattle. On to our question of the week: We get a lot of requests for addditions to the C# language and today…

15

Nullable types and Interfaces

There has been some discussion(http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackid=cdaf30a6-a601-43d7-8565-7096f82851ba) on whether T?, aka Nullable<T>, should implement the same interfaces as the underlying type T. At first glance, this seems reasonable enough – a T? is a little more than a T, so having T? implement the same interfaces as T should just fall right out.   Unfortunately, it is…

9

Command Line Parser Updated

I finally got around to updating my command line parser on gotdotnet. I can’t believe its been over a year. This update adds support for customizable help text, formatting of help text to the console window width, and better support for /?. Thanks go out to Jim Foster [JFoster at cskauto.com] for the help text code, and…

8

Many Questions: Generics Variance

One of the main benefits of the addition of generics to C# is the ability to easily create strongly typed collections using types in the System.Collections.Generics namespace. For example, you can create a variable of type List<int>, and the compiler will check all accesses to the variable – ensuring that only ints are added to…

7

Code Review: Double Checked Locking Code

A friend of mine recently sent me some code to review:   Hi Peter, Do you have any suggestions on how to clean up this code? In particular the creation of a particular singleton type doesn’t look very pretty in this model:   private DoubleCheckedLock<SingletonClass> myInstance = new DoubleCheckedLock<SingletonClass>(); public SingletonClass Current {     get…

4

Hello my name is Peter, and I write code …

I’ve been considering writing a blog for a while now. Up ’til this point I haven’t found a really good topic to kick off with, that was util today. I just had a conference call with a customer which resulted in a great topic for a blog. I’ll post that article in a day or…

3