Perceived SpeedPerception is reality. I am referring here to how users' observations can influence their like or dislike of your program. Application speed is a prime example. You may have written the fastest VB code ever, but it matters little if users think it runs slowly. VB programmers tend to get defensive when users complain about speed because the users dont know what the program is doing. However, you can incorporate a few tricks to make your program seem faster. The key to a programs perceived speed is that something needs to happen when a user clicks an icon. Users are more willing to wait if they think the computer is working as fast as it can. Booting Windows is a good example; it usually takes quite a long time. However, all the graphics, beeps, and hard drive noise keep you distracted enough to make the wait acceptable. The techniques discussed in the following sections give you suggestions for creating faster VB applications. Program Startup Time At the beginning of your program, you probably will have some initialization to perform[md]for example, opening a network database. The Sub Main subroutine is an excellent place for all the initialization code required at startup time. If your program has only a few forms ( two to five), you can load all of them during Sub Main so that they appear quickly when the application needs to show them. Although loading all these forms slows the applications performance at startup, the applications runtime performance is much faster. The Load method places the forms in memory, but they remain invisible to the users until the Show method is executed. However, this technique may cause program startup time to get a bit lengthy, so displaying a splash screen during load time is a good idea. A splash screen displays information about the program and its designer, as well as indicates to the users that some action is happening.
Inform the Users of Progress When your application looks like it is doing something, users tend to be more forgiving of long wait times. One way to keep them informed is to use a ProgressBar control on your form. If you are updating records in a database, you can use a progress bar to indicate the number of records processed so far. To do so, simply add an extra line of code or two to update the progress bar as you move to the next record. However, sometimes the progress bar is not an option. For example, Visual Basics FileCopy command might take some time depending on the size of the file. However, FileCopy is a self-contained statement, so you have no place to insert the progress bar update code. In this case, a video would be an easy alternative. Before starting the file copy, display a video with the animation control. Windows 95 uses this trick when copying files and emptying the Recycle Bin. The users see the video and think that it is linked to the file copy in progress when, in fact, it is a separate process running by itself. |
|
![]() |
![]() |
|||