Misc

A bad workman blames his tools

I wish that some people, when asking questions on a forum, would look inwards for a moment and reflect whether they really understand what they are talking about before making unfounded bold statments such as:

.NET is only one problem after another problem smiley_mad smiley_mad smiley_mad

One such poster on Code Project made a statement like that, then provided his code that was talking 2 minutes to run and that was unacceptable. He was blaming Microsoft and the .NET Framework but from one look at his code it was obvious where the problem was – and it wasn’t with Microsoft or the .NET Framework.

He wanted to update a column on a table. In fact he wanted to update that column on every row in the table. So, he pulled across 100,000 rows in to his .NET application then proceeds to loop over each returned row performing an UPDATE statement. So, in total he sent 100,001 commands to SQL Server. His complaint was magnified because he was expecting to have situations where 1,000,000 rows would need to be updated and that would take much longer. (20 minutes by the method he was employing)

Was the .NET application doing anything fancy as part of the update? No, it was simply copying the value from one column to another.

All his .NET code could be reduced to sending just one single piece of SQL to the database to do all the work. A simple UPDATE statement would do everything and take less than a second to execute – most likely even for a million rows.

But, did the poster seem to accept that perhaps it was his code or his misunderstanding of how the database could be leveraged that was at fault. No! He was insistant, with lots of angry faces, that it was Microsoft‘s fault for not getting the .NET framework right.

NOTE: This was rescued from the Google Cache. The original date was Wednesday, 5th April, 2006.

Tags:


Original comments:

Good Lord!
Did you reply to him with the obvious?
Maybe his next step will be to use a cursor within a single SQL statement and then blame the database!

ACK!

4/5/2006 9:23 PM | LJ

I told him how to get better performance, and I did point out that it wasn’t Microsoft‘s fault. It was his poor code.

4/5/2006 9:27 PM | Colin Angus Mackay

Don’t worry as his 386 workstation, with 4Mb of RAM and a dial-up modem will always ensure he is slow!

I’d have politely pointed out that his code “sucks”, what was wrong, what could be done to fix it then told him to get another career.

You should have linked to the CodeProject thread that shows this plonker in action!!!

4/5/2006 9:52 PM | John A Thomson

I find this a lot with rookies. Although, development these days requires you know a number of disciplines. SQL, ASP.NET, VB.NET/C#, HTML, T-SQL. Fast machines normally hide an inefficient programmer. That is why you need a jack-of-all-trades. Great blog.

4/19/2006 2:13 PM | Calvin

Oh yeah I know a few of them.

5/7/2006 3:37 PM | Derek Smyth

One thought on “A bad workman blames his tools

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