1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 4 - Working With Menus and Dialog Boxes - Part 3

By , About.com Guide

7 of 10

Notes about the Solution Code - Page 2

A note on the design of the If statements. The If tests one button for a "True" value because only one correct answer to the trivia question is assumed to exist. This might not be the case. Some questions might have several True responses. In that case, you would have to use a Checkbox component instead of a RadioButton and code the If statements differently. I mention this because it's the sort of "hidden assumption" that gets programmers into deep trouble every day.

Customer: We have to allow for multiple correct answers.
Programmer: B-b-but ... That will mean redesigning the database and then recoding all the response dialogs. It will cost the project an extra month of redesign, recoding, and retest!
Customer: Whaddayamean an extra month!!! The system is garbage without it!!! Why isn't this in YOUR crummy program already?

It's always a bad sign when it becomes YOUR program instead of the customer's program. This could have been prevented if the programmer had asked the right questions before starting to code. "Measure twice. Cut once."

Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Working With Menus and Dialog Boxes - Part 3

©2009 About.com, a part of The New York Times Company.

All rights reserved.