Top 10 Visual Basic Sins

  1. Not using option explicit
  2. Not explicitly declaring a data type for all variables and functions.
    Dim, Function, or Property without As <type>
    (Remember, this is NOT the same as using option explicit.)
  3. Writing unreadable code.
    Writing procedures longer than about 2 or 3 screens of code.
    Not using a variable, object, and procedure naming convention.
    Using the default object names provided by the VB IDE.
  4. Hard coding values which should be data driven or user-defined.
    Magic numbers
    Path or file names
  5. Lack of attention to the needs of the end user.
    Inappropriate use of jargon.
    Unfriendly error messages.
    Lack of attention to ergonomics.
    Poor alignment of controls.
    Deviating from standard windows UI guidelines without good reason.
  6. Writing fragile code.
    Not using appropriate error handlers.
    Failing to anticipate or recover gracefully from common errors.
  7. Not building reusable code.
    Using custom controls to do simple programming tasks.
    Putting too much code in event procedures.
    Not writing dedicated procedures for common tasks.
  8. Poor documentation.
    Failing to provide header and source code comments.
    Failing to provide supporting documentation.
  9. Improper use of data.
    Not limiting the scope of variables.
    Not validating inputs and/or outputs.
    Using inappropriate data types.
  10. Inappropriately using the assistance of fellow programmers.
    Asking for help without making an effort to learn.
    Not asking for help with complex problems.

By Joe Garrick

If you enjoyed this post, subscribe for updates (it's free)


I find it hard to learn when there is so much information to wade through that does not even remotely apply to what I'm doing (desktop apps). Microsoft heaps tons of unneeded features on us just to get our money. That's my take.

Heroin Detox

I am happy to find so many useful information here in the post, we need to develop more strategies in this regard, thanks for sharing.


"Failing to provide header and source code comments" - someone actually does it? :)