Editorials, Encryption/Data Security, Townsend Security

On Error Resume Next

MDX Training (Chicago)
Our training partner, SolidQ, will be hosting a hands-on, instructor-led course on Jan. 31-Feb. 2 from 8:30 a.m. to 4:30 p.m. in Lisle, Illinois. The course will guide students step-by-step through the Analysis Service 2008 Multi Dimensional eXpression (MDX) OLAP query language.

Tim Peterson, the course instructor and author of several books on Business Intelligence, will provide practical approaches to solve real-world problems using MDX expressions, calculations and queries. You will leave with techniques to extract valuable information that you can use for your own BI needs.

Full SSWUG.ORG members can receive a significant discount!

Click here to get started now

$$SWYNK$$

On Error Resume Next
I love it when I come across discussions regarding where did the clause “On Error Resume Next” go when vb was ported into Dot Net.

The very nature of the question demonstrates that people are simply moving from the old VB syntax to VB.Net without realizing that VB.Net now an object oriented language. New techniques for error handling are now required. Regardless, even in a modular language such as VB 6, using On Error Resume Next demonstrates a fundamental lack of how to develop modular software. To be honest, I was there too many years ago.

I remember reviewing code from a developer that had a number of functions and subroutines that didn’t do much. I wanted it all in a single function so that I didn’t have to jump around to understand what was going on.

Then I started to read more about the benefit of keeping the purpose of a function to a very specific purpose, and chaining functions together to build more complex capabilities. This has value even if those functions are never used elsewhere.
For me, the key reason is that a function that has a limited scope and limited number of options may be thoroughly tested. I know it works as designed when I use it elsewhere.

If your code is more modular, then the Dot Net Try/Catch technique is not cumbersome.
Frankly, the only time I remember using On Error Resume Next in VB code was trying to open a file before there were objects to test for file existence.

Tomorrow I’ll talk a little bit about the strategy of error handling. In the mean time, feel free to drop me a note in support of Try/Catch, or see if you can convince me that there is a valid, modern need for On Error Resume Next. Send your email to btaylor@sswug.org.

Cheers,

Ben

Featured Article(s)
The Future of PaaS: Preparing for a World of Developers and Data
By understanding and embracing modern development tools – starting with PaaS – there is a huge opportunity for DBAs to offer developers the guidance they need to build around data.

Featured White Paper(s)
Encryption & Key Management for Microsoft SQL Server 2008
Written by Townsend Security

Simplify encryption and key management on … (read more)

Featured Script
Script SQL Database DDL
A tool which scripts out SQL Server 2000/2005 database objects to individual files in a manner which mimics Microsoft’s Visua… (read more)