Chapter 9 Building Bug-Free and Robust Applications

Team Fly 

Page 215

Chapter 9
Building Bug-Free and Robust Applications

YOUR BASIC TASK, As a developer, is to write functional, robust applications. To write functional applications, you must keep the interface as simple as possible, use your common sense, and listen to the users. If you take the users' comments into consideration while designing your application's interface, you will produce a functional application. You should also carefully examine similar applications; keep the good ideas and make sure you don't repeat the mistakes of others. The design of functional applications can't be taught. If you've been around in this field for a while, you already know that this is an acquired skill and there's no substitute for experience. Younger developers tend to make their applications more complicated than they should, simply because they think that users will appreciate a brilliant piece of code. It took most of is quite a while to learn how to ''keep it simple."

Writing robust applications, on the other hand, is not as hard. While writing functional applications is an art, writing robust application is a technique and it can be taught. It takes a lot of code, but it's well within the average developer's skills. A robust application is one that will continue its operation under adverse conditions. The most typical such condition occurs when users supply the wrong data. Users will enter data that defy any logic and your code should be able to handle them. At the very least, the application shouldn't crash. Your application may discard some of the user-supplied data, but it shouldn't terminate without a good indication of what went wrong. If possible, you should give users a chance to correct their mistakes. At the very least, your application shouldn't terminate without giving users a chance to save their data.

In this chapter we'll discuss structured exception handlers, which allow you to write robust applications that execute gracefully even under unforeseen conditions. The goal is to write applications that can handle everything users throw at them, as well as cope with unexpected situations beyond the program's control. To handle user errors, we provide extra code that can handle situations that throw off the "regular" code ("regular" code being all the statements that process perfect data).

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net