Tuesday, October 31, 2006


Get Well Soon, Frank

Microsoft's Frank Arrigo is a champion for developers here in Australia (and elsewhere in the world). He posted in his blog a few days ago that he was feeling unwell and next thing he's had his appendix removed. Unfortunately, that wasn't the problem.

As Charles Sterling pointed out, you can drop him a note at:


Development Zen

Treat the cause, not the symptoms!

Sunday, October 29, 2006


Daily Developers Wants You!

The Daily Developer site needs your help. We want you to add some content, no matter how small. This site has been set up so that developers like yourself can share tips and experience and help others. The content theme of the site is anything to do with the day to day life of being a programmer. Come on, you know you want to!


Give your résumé a face lift

This is a quick on-post of an article I came across, that might be of interest for anyone currently looking for a new job, Give your résumé a face lift.

Saturday, October 28, 2006


Missiles, Money, Cabs

Some time ago I watched Martin Grenell's presentation "How to get your Grandmother to Build Missile Defense Systems", and in it he briefly showcased an application built using the Composite Application Block called CommSee, an internal application written and used by the CommonWealth Bank of Australia. This presentation is downloadable from the PDC 2006 webcast series. [The Composite UI Application Block is a proven framework for creating 'pluggable' applications, based on the MVC/MVP composite pattern].

While I was watching his excellent presentation, I thought it would be interesting to find out more about the design and process behind this application. Well Ron Jacobs has done just that over at Arcast. Nice one, Ron!


TechEd 2006 WebCast Series

If you haven't seen this already, you can download around 140 of the TechEd 2006 webcast and breakout sessions. It never ceases to amaze me how many resources Microsoft offer for free. [They also seem to have streamlined the registration/download process somewhat. Thanks Ron!]

In fact, Dan Appleman (the VB legend) recently commented on this phenomena, mentioning what it was like to develop software back in the mid to late 1980's, before Google and when documentation was a lot scarcer than it is now!

Friday, October 27, 2006


Microsoft Privacy Guidelines

Microsoft have released a must read, downloadable document Privacy Guidelines for Developing Software Products and Services based on their internal privacy guidelines.
Before collecting and transferring personal information, you, as the entity
requesting the information, must have a compelling business and customer value
proposition. A value proposition that benefits customers may create a
natural incentive for them to entrust you with their personal information.
Only collect personal information if you can clearly explain the net benefit to
the customer. If you are hesitant to tell customers “up front” what you
plan to do with their information, then do not collect their data. This
applies to data collected and stored locally on the customer’s machine or
transferred over the Internet.


Windows Vista Blog Gets a Facelift

Jim Allchin has re-released the Windows Vista blog with more of a 'Vista' feel. The previous site was infrequently posted to, and this time Jim is pushing his co-workers to improve the content. If you're already running Vista, they are looking for feedback.

Wednesday, October 25, 2006


Better Presentation Tips

Kathey Sierra has posted an article on how to start a presentation, book, article… and as usual it’s worth reading. A few hilights are:

You should not:

  • Start at the beginning
  • Tell, show instead
  • Start with history
  • Start with pre-requisites

You should:

  • Begin with a question
  • Be provocative
  • Evoke empathy
  • Do something surprising
  • Start with something funny
  • Start with a dramatic key event or turning point
  • Have some mystery, suspense or intrigue

Monday, October 23, 2006


The T-SQL Way: Converting Integers to Binary Strings

A post over at Rob Farley's blog on converting integers to binary using Transact-SQL caught my eye and it reminded me of a challenge a fellow developer gave me a few years ago, namely that I couldn't speed up one of the VB functions he had written with the condition that it must still be written in VB. I did, by 3 orders of magnitude!, but that's another story...

My solution is probably not quite as elegant as Rob's CTE solution but I reckon it might be faster and use less memory. In fact there are two very similar function based solutions. One is certainly more readable than it's slightly faster counterpart.

Originally, I used the formula as the basis for a computed column, like so:


intVal int ,

binaryStr AS (

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , (IntVal / 268435456) * 4 + 1, 4 ) +

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , ((IntVal / 16777216) & 15) * 4 + 1 , 4 ) +

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , ((IntVal / 1048576) & 15) * 4 + 1 , 4 ) +

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , ((IntVal / 65536) & 15) * 4 + 1 , 4 ) +

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , ((IntVal / 4096) & 15) * 4 + 1 , 4 ) +

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , ((IntVal / 256) & 15) * 4 + 1 , 4 ) +

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , ((IntVal / 16) & 15) * 4 + 1 , 4 ) +

SUBSTRING( '0000000100100011010001010110011110001001101010111100110111101111' , (IntVal & 15) * 4 + 1 , 4 )



-- Test values

insert into #t VALUES (0)

insert into #t VALUES (1)

insert into #t VALUES (2)

insert into #t VALUES (3)

insert into #t VALUES (4)

insert into #t VALUES (15)

insert into #t VALUES (31)

insert into #t VALUES (65)

insert into #t VALUES (127)

insert into #t VALUES (128)

insert into #t VALUES (129)

insert into #t VALUES (65535)

insert into #t VALUES (65536)

insert into #t VALUES (166754132)

insert into #t VALUES (1073741824)

-- int's are signed, max value is therefore, 2^31 - 1 = 2147483647

insert into #t VALUES (2147483647)

select * from #t

The first function version is:

CREATE FUNCTION IntegerToBinaryString(@intval int)

RETURNS char(32)



DECLARE @bincode char(64)

SET @bincode = '0000000100100011010001010110011110001001101010111100110111101111'


SUBSTRING( @bincode, (@IntVal / 268435456) * 4 + 1, 4 ) +

SUBSTRING( @bincode, ((@IntVal / 16777216) & 15) * 4 + 1 , 4 ) +

SUBSTRING( @bincode, ((@IntVal / 1048576) & 15) * 4 + 1 , 4 ) +

SUBSTRING( @bincode, ((@IntVal / 65536) & 15) * 4 + 1 , 4 ) +

SUBSTRING( @bincode, ((@IntVal / 4096) & 15) * 4 + 1 , 4 ) +

SUBSTRING( @bincode, ((@IntVal / 256) & 15) * 4 + 1 , 4 ) +

SUBSTRING( @bincode, ((@IntVal / 16) & 15) * 4 + 1 , 4 ) +

SUBSTRING( @bincode, (@IntVal & 15) * 4 + 1 , 4 )




This uses a concatenated string of the 4-bit binary string representations of 0 to 15, indexed by the 32-bit input integer broken into 4-bit chunks. You can reduce the number of arithmetic operations still further by creating a combined string of the 256 8-bit combinations:

CREATE FUNCTION IntegerToBinaryString2(@intval int)

RETURNS char(32)



DECLARE @bincode256 char(2048)

SET @bincode256 = '00000000000000010000001000000011 ...'


SUBSTRING( @bincode256, (@IntVal / 16777216) * 8 + 1, 8 ) +

SUBSTRING( @bincode256, ((@IntVal / 65536) & 255) * 8 + 1 , 8 ) +

SUBSTRING( @bincode256, ((@IntVal / 256) & 255) * 8 + 1 , 8 ) +

SUBSTRING( @bincode256, (@IntVal & 255) * 8 + 1 , 8 ) )



[Note: I originally posted the whole 2048 characters of @bincode256, but it caused my blog some alignment problems! You can either use the technique of small cranes to build big cranes, using the following T-SQL snippet to call the first function to create the string, and then cut and paste it, OR type it in yourself. Personally, I 'd go with the first suggestion!

DECLARE @i int

DECLARE @res varchar(2048)

SET @i = 0

SET @res = ''

WHILE @i < 256


SET @res = @res + '' + CAST(Substring(dbo.IntegerToBinaryString(@i), 25, 8) as varchar(8))

SET @i = @i + 1


PRINT @res


I'm not sure what Rob and Omnibuzz (!) use for their timing harness or test dataset but hopefully, I'll follow up with relative timings.

Rob's was originally inspired by this post.

Thursday, October 19, 2006


Windows Forms

If you write Windows forms applications for a living then you will probably have visited the Windows Forms site before. If not, it has interesting articles, sample code, downloads and upcoming trends you should know about. Worth a visit.

Wednesday, October 18, 2006


Using ASP.NET 2.0: CompareValidator Controls

You can use a <asp:CompareValidator> control to validate one control against another or against a fixed value. I spent an hour searching for a way to use one to validate a date that should be greater than or equal to today’s date. My initial attempt was

<asp:CompareValidator ID="cvFromDate " Text=" Date cannot be less than today's date!" ControlToValidate="txtFromDate" Type="Date" Operator="GreaterThanEqual" SetFocusOnError="true" Display="Dynamic" Runat="server" ValueToCompare="<%= DateTime.Today.ToShortDateString() %>" />                       


But it did not like the fixed date value. Interestingly, several articles I found said this was possible, but I had no luck getting it to work (I suspect this is due to initialisation and binding event order?). The simple solution is to set this value during the page’s load event:

   if (!IsPostBack)


       cvFromDate.ValueToCompare = DateTime.Now.ToShortDateString();

The final ASP.NET code which also includes a compare validator to check the same control for dates in valid formats is:

<asp:CompareValidator ID="cvFromDate" Text=" Date cannot be less than today's date!" ControlToValidate="txtFromDate" Type="Date" Operator="GreaterThanEqual" SetFocusOnError="true" Display="Dynamic" Runat="server" />  


<asp:CompareValidator id="CompareValidator1" Text="Please enter a valid date format." ControlToValidate="txtFromDate" Display="Dynamic" Type="Date" Operator="DataTypeCheck" SetFocusOnError="true" runat="server" />


Development Zen

Any task that is repeatable is a candidate for automation

Any coding task that is repeatable is a candidate for code generation

Tuesday, October 17, 2006


More Free .NET 3.0 Resources: .NET University

.Net University? It might sound a little corny, but hey it’s another free resource for getting up to speed with .NET 3.0 (WPF, WCF, WF and CardSpace).

“Content is freely downloadable, and available for re-delivery to technical
audiences…includes four 75 minute lectures and four 30 minute labs.”

Thanks to tip from Brian Randell


Advanced Article on ASP.NET 2.0 Master Pages

Whilst searching for the solution of referencing a control defined in a content page from JavaScript, I found this great article ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps by K. Scott Allen. It’s definitely one of the most comprehensive, in-depth articles I’ve come across (despite having bought two fairly advanced books on ASP.NET 2.0!). Scott Guthrie linked to this article a while ago here. The article describes how master pages and content pages are combined, event ordering, interacting between the master page and content pages and vice versa, JavaScript and naming containers, and name mangling (the bit that solved my particular problem).

Monday, October 16, 2006


Free E-Learning Courses:

Sunday, October 15, 2006


Database Refactoring

A post over on Larry O'Brien's blog prompted me to put together this short list of resources that can assist with database factoring and understanding an unfamiliar database:

  • Visual Studio CTP for Database Professionals, you can download CTP 5 – Beta here.
  • Red-Gate's SQL Dependency Tracker (14-day trial download available). Larry notes:
    “One limitation is that the tool does not have a "Print" capability. I would
    like to print out a (huge, wall-sized) poster of the dependency for study. It
    does, though, have an "Export to image..." capability. If you save to .PNG it
    does not preserve detail, but if you save to .EMF, you can import it into
    Illustrator and divvy it up there.”
  • The book “Refactoring Databases: Evolutionary Database Design” by Scott W. Ambler and Pramod Sadalage, has received excellent reviews (unfortunately mine is on order). There is a dedicated website here
  • Sparx Systems Enterprise Architect is a comprehensive database design tool.

Having access to an A1 size plotter is also very useful!

Saturday, October 14, 2006


Snap Back to Reality

I just had to post about this LifeHack article because it quotes my favorite rapper and modern day poet, Eminem (Please come back, Please come back!).


CSS Layout Tools

Saw this great tip via Eric Gunnerson’s blog post on two tools that can help with web page layout and design. I’m in Eric’s corner when it comes to CSS; I’m definitely no expert, and need all the help I can get!

CSSVista lets you see the effect on CSS changes in real-time:

CSSVista is a free Windows application for web developers which lets you edit
your CSS code live in both Internet Explorer and Firefox simultaneously. … This
is a very early version of the software. It probably won't explode, but it may
not work perfectly 100% of the time.
The IE Developer Toolbar has a DOM viewer that lets you see a tree view of how a web page is structured.


SQL Server 2005 Practical Troubleshooting

Here’s one SQL Server 2005 book I’m really itching to get my hands on: SQL Server 2005 Practical Troubleshooting by Ken Henderson.

Ken posted a blog entry on his new book here. If you have not heard of Ken Henderson before, he is renowned for his excellent ‘Guru’s Guide’ series books on T-SQL and SQL Server internals.



Rob Farley posted an entry on how skills are evaluated at both the CV and interview stages when employers are recruiting staff. I agree that having certifications increases the odds that you know more than the next guy, but I think the phrase "Use it, or lose it!" certainly applies. Certification coupled with real-world experience is definitely a plus.

Several months ago, I spoke with guys in an IT department and they actually thought it was a minus when candidates had a MCSE due to the fact there are so many BrainDumps out there. They had interviewed a large number of candidates and a pattern emerged that a large proportion of people were getting the MCSE but had very little on the job experience. I know Microsoft is making headway against the dumpsters by steering towards sandbox exams where you actually have to perform some task in a ‘live’ simulated environment. This is a much more realistic way of accessing skill levels and much harder to ‘cram’ for.

Earlier this year (and the end of last year) I participated in the SQL Server 2005 beta exam program. The interesting thing about the beta exams is that there is very little information around at the time you take them.

As an aside, I've attended a couple of interviews recently and not one of the interviewers asked me about my MCSD and MCITP SQL Server 2005 certifications, or wanted to see any proof of passing. But I still think they are worth having.

Friday, October 13, 2006


Web Design Tips

I would hardly call myself a web designer, so I always take note of resources that can help with the look and feel of web pages. Here a few resources I’ve found. There is a superb and short web design tutorial here by Jennifer Apple, including links to other great resources. Elsewhere on the site, she has advice on using subtle borders to make images really stand out.

You can find a lovely web based colour scheme generator here. This is one of the best and easy to use that I’ve come across. Have a quick read through the help section, where you will find tips on creating an optimal colour scheme.

I can also recommend Scott Kelby’s very accessible book “Photoshop CS2 for Digital Photographers”.

(You can tell I’m originally from the UK, by my refusal to spell ‘colour’ as the US version, 'color’!)


Stock Photographs

I've been a keen photographer for several years, and have a few images with the UK based stock photography agency, Alamy. I'm particularly fond of designs in nature and abstract themes. The whole stock library scene has changed dramatically since high quality digital became affordable.

Stock photography by Mitch+Wheat at Alamy
Stock photography by Mitch Wheat at Alamy

A professional photographer (it may have been Roger Garwood) once told me that unless you have 1 or 2 world famous images, you can expect to earn $1 per year for every 100 photographs you have in stock. I don't think he was too far out with that estimate!

Thursday, October 12, 2006


Virtual PC 2007 Beta Available

You can download from here (need a Microsoft passport to login). The good news is that it supports running Windows Vista in a virtual machine and running virtual machines with Windows Vista as the host OS, as well as improved performance.


Code Complete (by a Code Complete Zealot!)

I am often surprised (actually horrified!) to find programmers/developers that have not even heard of Code Complete (by Steve McConnell), let alone read it. If you are a programmer who has not read Code Complete then you should. It should be a required book for all university computer science courses, purchased on day one and lovingly cherished during the course of your studies! Recently, a programmer surprised me even more by belittling it without even having read it (you know who you are). Shame on you!

Every time I pick up ‘Code Complete’ I learn something from it. I am not exaggerating. I’ve owned a copy of this book for a little over 10 years (now in its second edition), and I learn something useful every time I pick it up. I could perhaps say that of only a handful of books. It might be something I’ve forgotten to pay sufficient attention to rather than something earth shatteringly new, but nonetheless I learn something. Don’t take my word for it, do a few searches yourself and look at the accolades, praise and comments by respected practioners.

Actually, now I think about it, I’m not really a Code Complete zealot, just someone who hates reinventing the wheel, especially square shaped ones…

Wednesday, October 11, 2006


Transact SQL SARGs (Search Arguments)

The term SARG (or search argument) is used to describe whether a Transact SQL WHERE clause will be able to take advantage of any indexes present on columns in a table.

For example, this can use an index:

SELECT SomeColumn FROM MyTable
WHERE SomeColumn LIKE ‘Whea%’
But this can not:

SELECT SomeColumn FROM MyTable
WHERE SomeColumn LIKE ‘%eat’

This important topic is covered in some detail in the following references:

pgs 351 - 368, Guru's Guide to Transact-SQL, Ken Henderson
pgs 318 - 326, SQL Server Performance Tuning Distilled, Sajal Dam

SARGs are also mentioned in this more general performance tuning article.



CodeRush is truly a marvel. It’s an add-in to Visual Studio that makes coding more productive. It really is a superb tool; after you use it for a few days, you’ll wonder how you managed to code without it. In my opinion, there is only one thing wrong with it: the price tag of US$299.00 (approx AU$400) for a single license. If it cost US$149.00, I would have purchased it without giving it a second thought (I think developers that are buying their own tools or operate as one-man shops will not be able to justify the current price tag. I’m not suggesting they should give it away; I realise how much it costs to create something like this, but they may need to re-think their licensing scale.

CodeRush is well worth checking out. To receive an evalution copy you will need to send an email to the address on this page. There are several training videos here. Scott Hanselman covers CodeRush in part 4 of his Productivity Tools for Developers webcast that I linked to.

Tuesday, October 10, 2006


More Agile...

I've just noticed that Jeff Atwood has posted comments on Steve Yegge's most recent post. I think he puts it much more eloquently than I did:
"In order for programmers to be effective, they have to believe in what they're doing. Whether that belief is scientifically and empirically provable or not is completely irrelevant"


Google's Code Search

A colleague, Vaughan De Vos, emailed me to ask if I knew about Google’s Code Search site. I saw this briefly last week, and thinking it was just Google with a few query modifiers, I didn’t pay it enough attention. I’ve tried a few searches and the results are interesting.

EDITED TO ADD (11th Oct 2006): Static Code Analysis Using Google Code Search


For a Few Test Cases more…

Steve Yegge caused such a stir with his original post on Agile methodology that he’s written a follow up, Egomania Itself (in case you’re wondering, it’s an anagram of Agile Manifesto!). He covers a lot of ground with references to some very important concepts such as “selective reinforcement” and advocates commonsense when he observes ‘Whenever you hear Agile people asking around for "success stories", remind them politely that only looking at the positives is pseudoscience.’

Using Agile will not guarantee a project’s success. People will. But the central tenet of Agile is “People First”. Rather than talking about whether Agile works or not, we should be extracting those things that do and applying them where appropriate. Test driven development to me seems a no-brainer (despite the fact I still struggle to write code this way). Steve Yegge writes well, and I believe he makes several excellent points, but I don’t agree with every point.

“Most great software developers around the world don't use Agile. They just work hard, they stay lightweight,…” but wait, isn’t lightweight exactly what the Agile camp say is the second most important thing you should take care of (after people)?

Steve references a superb ACMQueue article by Jef Raskin titled “When we don't understand a process, we fall into magical thinking about results.” I believe that every developer should read that article. I have long believed that one of the personally traits that benefits programmers greatly, namely seeing patterns quickly, can also become a drawback if we make connections where none are present. Seriously, if you read just one article this week, read Jef’s.

Monday, October 09, 2006


Bruce's Snake Oil!

This article on how to spot bad security/cryptography by Bruce Schneier dates back to 1999, but is still relevant today. I have several of Bruce's books; he's always a good read.


SQL Code Camp, Wagga

Rob Farley just pointed me to Crucible's blog where he has a write up on the sessions held at SQL Code Camp in Wagga over the weekend. Sounds like it was well worth attending. Some of the material is available online from the various presenters blogs. We were lucky to have Greg Linwood here in Perth a few days earlier where he presented two SQL Server indexing talks, so I didn't miss out entirely!


Tips for Effective Meetings

Planning the Meeting
  • Whenever possible do not meet!
    - Meetings are time consuming, so decide whether a meeting is the best way to handle the issues/topics?
  • Define the purpose of the meeting
    - Write down a clear goal and desired outcomes
    - Decide who should attend based on the desired outcomes
  • Keep meetings short
    - Do not allow meetings to overrun
    - If there is unfinished business, schedule for another time
  • Always issue a meeting notification
    - Give attendees sufficient notice to enable them to prepare any relevant material
    - State the place and time for meeting
    - State the duration of the meeting
    - Confirm attendees acceptance
  • Always distribute an agenda to attendees before the meeting takes place
    - Meeting objectives
    - List of discussion topics
    - Place highest priority items first on agenda
    - Provide attendees with any required background information
  • Make sure that speakers are prepared for the meeting
    - Unprepared speakers will contribute little
  • A meeting should have an owner or chairperson
    - The chairperson should open the meeting by describing the meeting objectives and expected outcome of the meeting
    - The chairperson should ensure speakers adhere to the agenda and time allocated
  • Make sure that speakers are prepared for the meeting
    - Unprepared speakers will contribute little
  • Make sure the facilities are prepared for the meeting
    - Arrange any audio-visual equipment or materials in advance. Arrive early to set up and make sure everything is ready to use

Running the Meeting

  • Start the meeting on time
    - Do not wait for latecomers
  • Start the meeting by reviewing the meeting agenda and objectives
    - Begin by introducing anyone who is not known to the other attendees
  • Appoint someone reliable to take minutes
    - Ensure that the minutes are accurate
    - If it is not recorded it probably will not happen
  • Stick to the agenda
    - Maintain focus, keep the discussion on track
    - Summarise conclusions or decisions as each agenda item is completed
    - Non-agenda issues/topics should be noted and discussed in the last 5 minutes of the meeting, and if unresolved, tabled for another meeting.
  • Assign action items
    - Identify and assign any action items to specific people with completion dates
  • Explicitly close the meeting
    - Before closing the meeting determine if the objectives were met
    - Request comment from all attendees, and enter into the minutes
    - Chairperson should provide a concise summary of the meeting’s outcome
    - Issues/topics requiring further discussion should be noted
  • End the meeting on time
    - Often people will have other scheduled work to go to
  • Minutes should be published and made available to all attendees

Meeting Follow up

  • Communicate the meeting’s decisions to those who are affected by them
  • Make sure copies of the minutes are distributed
  • Remind people what they agreed to do

Sunday, October 08, 2006


Interaction Design

I was interested to see that Nick Randolph mentioned the role of interaction designer recently on his blog, when discussing the demarcation of roles in the design/development process, prompted by disagreeing with Brian Madsen’s blog post, following Greg Linwood's presentation. I’ve been talking about this essential role for a number of years and I mostly get blank stares or a bit of eye rolling, and/or finger twirling when I do!

Although I agree that interaction design is a vital part of the development process, I disagree with Nick when he states “This role [developers] should NOT be concerned with how indexes are structured etc,…”. I believe that developers SHOULD have an understanding of how indexes are structured and used. In fact, the principle of treating systems in a more holistic fashion avoids ‘pigeon holing’ and the “it’s not my problem attitude”. In larger teams, it is highly beneficial to have people spanning roles so that they can bring understanding and promote communication between disciplines and teams.

Interaction Design is something I passionately believe in as a way of ensuring that software meets and (better still) exceeds users’ expectations. The aim should be to create applications that need little or no help, “I shouldn’t have to read the manual to understand how it works”. It is possible. I have used the technique to produce a very successful application, which required minimal training even though the system contained a reasonable amount of complexity. One recent UI technique that I think should be highly valued is the ability to add ‘watermarked’ text (pale gray) to empty controls. For example, in a person’s name control you could set the watermark text to “Wheat, Mitch” explicitly showing the format the field expects data to be entered in. This eliminates ‘cognitive friction’ on the part of the user because they don’t have to think “Is it last name first, followed by a comma, or should a name be entered the way it is read?”.

In fact, more than just creating systems that are easy to use, our aim should be to create passionate users. Kathy Sierra and others, post wonderful articles on creating passionate users here.

Interaction design is something Alan Cooper (the father of Visual Basic) has been involved with for some time (you could even say he pioneered it), and has published several great books on the topic, the most notable being The Inmates are Running the Asylum, but also About Face 2.0.

Saturday, October 07, 2006


.NET Framework 2.0 Breaking Changes

For anyone about to convert an existing .NET 1.1 application to 2.0, here is a list of runtime breaking changes.


Developer Zen

These four words encapsulate the most important and fundamental rule of design:

Be Your Own Client

or to put it another way: Put yourself in the place of the user (consumer).

Friday, October 06, 2006


Use Token Handle Resolution API to get the Metadata for Reflection in .NET 2.0

One of the most common uses of reflection is in the use of plug-ins, such as toolbars or hosting third party plug-in functionality. A developer I worked with recently was unaware of the appropriate uses of reflection (let’s call him Bugsy!). I’d like to direct him to the words of Joel Pobar, who you might say is an expert on this topic (Joel is a Program Manager on the common language runtime (CLR) team at Microsoft, at least he was till last week!):

When Should You Use Reflection?
You should always think carefully about how you're using reflection. Using reflection occasionally without enforcing strict performance criteria is probably fine. If reflection APIs are only invoked when you're calling the part of your app that loads and invokes a third-party plug-in, then the cost should be reasonable. However, if your scenario involves a high-volume ASP.NET Web site that requires good throughput and response times, and if it makes significant use of the heavy reflection APIs in your "fast path" (the code in the application that must run very fast and is used repeatedly), you should really consider an architectural review to decide if you've made the right decisions on your use of reflection.

Where was he using reflection? Between the business rule and data access layers in an ASP.NET 2.0 financial application! (and no, he seemingly had not heard of code generation, despite several attempts to enlighten him). That architectural review sounds appropriate…

Relative performance of Invocation Mechanisms (image from MSDN article)

Scott Hanselman has a Hanselminutes webcast on the subject here.

How can you improve the speed of reflection based calls? J.D. Meier’s post details the use and the performance benefits of the new .NET 2.0 reflection API:

“RuntimeMethodHandle works approximately twice faster than compared to equivalent GetXxx API call, if the MemberInfo is not present in the back-end .NET cache”

To round off this post, here’s yet another free resource from Microsoft “Improving .NET Application Performance and Scalability” (all 1150 pages of it!)

"Information is segmented by roles, including architects, developers, testers, and administrators, to make it more relevant and actionable. This guide provides processes and actionable steps for modeling performance, measuring, testing, and tuning your applications."
By complete coincidence, I’ve been talking to a colleague about .NET performance tuning and I’m hoping to put an article together in the near future, so stay tuned.

Thursday, October 05, 2006


Indexing for Developers

Greg Linwood gave an excellent presentation of his SQL Server “Indexing for Developers” talk at the Perth .NET User Group last night. He covered the use of clustered and non-clustered indexes and how they actually work ‘under the hood’.

I believe that it is important for developers and architects to understand these topics, as databases are often created without regard to how they will be used in production, with the effect that production systems do not perform as well as they could do.

Greg is presenting another talk this evening (details here) aimed at database administrators (but also relevant to developers) on managing indexes. If you work with SQL Server, I strongly recommend you attend these talks when Greg presents them at a local User Group near you.

Wednesday, October 04, 2006



If you don't receive the MSDN Flash email, you may not have come across RSSBus. It allows creation of RSS feeds from a variety of sources, such as databases, spreadsheets, e-mails and folder content. It looks very interesting and I can think of a number of uses within an enterprise.

Tuesday, October 03, 2006


Another .NET Developer Resource

Fancy a few nuggets, without the secret herbs and spices? I stumbled across the MSDN Nuggets site at Microsoft UK. It has been created by the Microsoft UK Developer and Platform group, and looks interesting. As a nice touch, the monthly archives are downloadable as a single zip file (why can't you do this with webcasts by track on the main Microsoft site? Please?).
Don't have the time to read a 10-page how-to article or watch a full length
webcast? Try an MSDN Nugget, a webcast that takes you step-by-step to
discovering new functionality or exploring a hot developer topic, all in 10-15
minutes. View them online now or download for later reference.

Mike Ormond's blog has links to online/offline viewing tools here.


The Broken Window Effect

Why should you fix a code problem as soon as you find it? If things break, a classic example are unit tests, and they do not get fixed, then other breaks appear and get left broken. This effect has a tendency to escalate to the point where people ignore unit tests, eliminating the benefit that units test provide.

The effect was coined as applied to vacant buildings. As soon as a single window is left broken, others will follow and the effect actually spreads out from the building into the neighbourhood. It is easy to imagine that this effect is real; just apply it to the house you live in. If you leave something that requires attention, you are more likely to leave other things as well (I have experienced this effect first hand!).

This principle of Fixing Broken Windows was documented in the US, and has its critics due to the fact that in society it is hard to eliminate/identify all other contributing factors.

Andrew Hunt and David Thomas used “Fixing Broken Windows” as a metaphor for avoiding software entropy in software development in their book, The Pragmatic Programmer. Next time you are coding and you see something that is broken, maybe you should err on the side of caution and fix it?

(Not to be confused with the Parable of the Broken Window)



Patrick Altman reminded me of a question I raised on the [aus-dotnet] list several weeks ago, regarding inheriting from BindingList<T> rather than List<T>. BindingList<T> is designed for data binding and data changed event notifications. If you derive from List<T> and you want to be notified when someone changes the collection, you will have to implement this yourself. David Kean has an excellent blog post on this subject and why FxCop encourages exposing Collection<T> over List<T> here.

The reason I mention this is because at a company where I was working recently, the programmer responsible for writing framework code was not aware of this. Thanks to David Kean, Bill McCarthy, Paul Stovell and Mitch Denny for their input.

Monday, October 02, 2006


What is a Lifehack?

Lifehack.org is one of those places you go when either you want to think about something other than programming (perish the thought!), or examine and possibly improve some area of your life. Creating Hardworking Idiots caught my eye:
Today’s fast-paced, macho style of organizational culture creates, and then
fosters, the hardworking idiot. Indeed, I think it takes a great many sound,
useful, hardworking, and clever people and turns them into idiots by denying
them the time or the opportunity to think or use their brains.


Drinking the Office Kooler RAID

Saw this fun post on diggdot.us: Explaining RAID technologies to new clients


Elementary, Dr. Solomon!

Mark Russinovich has understandably not blogged for a while, as I daresay he was a little busy with his recently taken role at Microsoft. He breaks this drought in Holmes-esque fashion with this excellent post sleuthing his way through the labyrinthine windows internals using Filemon. The article mentions the simple but very effective technique of loading lengthy traces into Excel to discard time and sequence related columns and using Windiff to quickly find answers.

If I had to name a Windows programmer who has had a huge impact in the developer community, it would be Mark and the essential tools from SysInternals.


Congratulations, Rob!

Congratulations to Rob Farley on being awarded his MVP. Rob is active in the newsgroups, his local Adelaide based SQL Server user group and developer community and is always willing to help out someone with a problem (I've probably missed a stack of other things). Great news Rob, it's well deserved.


Restoring Smart Tags in the C# IDE after installing LINQ Preview May 2006

I've been trying out LINQ recently (C# 3.0 language enhancements post coming up) and one of the irritating things I noticed was smart tags no longer work correctly. Karen Liu has posted a fix here.


Powered by Blogger