Home > Articles > Programming > .NET and Windows Programming

Seven Steps to Improving Your VB Code

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss

Like this article? We recommend

Many people learn to program by trying Visual Basic. At some point, though, they must go beyond those introductory first victories. In this article, John Tränkenschuh, VB instructor at his local university and Microsoft MVP since 2004, discusses seven increasingly important improvements that VB coders must make if they want to go beyond being mere macro writers.

I teach Visual Basic. I love it. It’s been good to me, all the way back to VB3. VB usefulness is growing wildly, but why do actual VB coding practices seem to lag a bit?

Maybe it’s the utility that has 19 buttons framing the form because the beginner never learned menus? Maybe it’s the button code view that spans multiple screens?

The problem isn’t VB. With a few basic improvements, VB coders can produce better code.

I like to offer beginning VB coders seven basic improvements. Consider using these tips in your next coding project. I’ve tried to prioritize them by order of importance. Here goes!

1. Normalize the Interface: Follow Windows Interface Standards

This step should be first on your list because it’s the easiest to implement. Create a document in Word. What is the shortcut key for printing? Now open Excel. What is the shortcut key for printing? People learn applications more quickly when coders follow interface standards.

Beware of implementing unique keyboard shortcuts or of giving the "standard" shortcuts new meaning. Redefining Ctrl+P to be Pause...well, that’s unnatural to users who have been trained to use that for printing.

People like menus. Littering your form with stacked buttons only confuses people. Never adjusting tab order to go with the natural flow of your application is frustrating to us keyboard users. So where can you find interface standards?

The Windows Vista User Experience Guidelines have great information on Vista, which has some neat changes to the older standards.

Boring? So how do you sell a more natural-looking application? There are a lot of freeware and shareware programs out there. Study them. Study the Office products. Study Visual Studio. Create a chart of the basic interface elements. Note similarities. Challenge yourself to follow standards.

  • Share ThisShare This
  • Save To Your Account
Doing Objects in Visual Basic 2005

Like this article? We recommend

Doing Objects in Visual Basic 2005

Learn MoreAdd To Cart

Discussions

comments powered by Disqus

Related Resources

#TuesdayTrivia: Spotlight on WP7 (Win a copy of Sams Teach Yourself Windows Phone 7 Application Development)
By on May 2, 2012Comments
These days, what CAN'T a smartphone do? Microsoft is putting their own spin on things to help you experience "life in motion" when using your device. Instead of containing static application icons, the re-imagined Start screen features live Tiles showing real-time content updates.

March Trivia #1: Let there be light! (Win Microsoft Visual Studio LightSwitch Unleashed)
By on March 13, 2012Comments
Want a simplified self-service tool to help you build business applications for the desktop and beyond? Microsoft programmers… meet Visual Studio LightSwitch.

February Trivia #2: There's an App for That (Win Sams Teach Yourself iOS 5 Application Development in 24 Hours)
By on February 28, 2012Comments
In less than a decade, the iOS platform has changed the way we think about mobile communication.

See All Related Blogs