Drawing Blanks

Premature Optimization is a Prerequisite for Success

Microsoft promoting anti-patterns

leave a comment »

Found this today in production code that I needed to modify:

… = ((TextBox)(row.Cells[1].Controls[0])).Text;
… = ((TextBox)(row.Cells[2].Controls[0])).Text;
… = ((CheckBox)(row.Cells[3].Controls[0])).Checked;

This was in a GridView.RowUpdating handler, and the change that I needed to make was adding a couple of columns to that grid.

Of course, I refactored the code in that page, and, of course, I found that all pages in the project are copy-paste-contaminated by that terrible pattern.

I did some lurking on google for grid view “best practices” and found something that is likely the origin of the infection:



Written by bbzippo

06/08/2012 at 4:53 am

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: