Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic
Calculating a Contrasting Color Code
Part 7: Lessons Learned
 More of this Feature
• Part 1: VBA - Calculating a Contrasting Color Code
• Part 2: The First Solution Attempt
• Part 3: The Second Solution Attempt
• Part 4: The First Bug
• Part 5: Symbolic Logic in Visual Basic
• Part 6: The Second Bug and VB .NET
 
 Join the Discussion
Is this the kind of article that helps you?
Let us know!
 
 Related Resources
• Beginning Visual Basic
• Visual Basic 6
 
 Elsewhere on the Web
• A short intro to binary numbers
• Binary, Decimal, and Logic
• Color Differences
VB 6 versus VB .NET

 

1 - First and Foremost - Do code walkthroughs !
If you care at all about good programming, walk through your code with another programmer.

I was a supervisor and project manager for twenty years and the worst problem that a programmer can have is to be unwilling to expose and explain (and document) his or her code. The tragedy is that some of the best and most brilliant programmers are the least willing to do this. But the failure to do it is the "kiss of death" for quality programming no matter how brilliant the programmer is.

My initial program, after all, did work. The first clue that something might be wrong came from an independent review by another programmer.

2 - Know the fundamentals.
Subjects like symbolic logic, hex and binary calculation, and the fundamental properties of data types are sometimes thought of as "bor-ing" by today's object oriented and visual programmers. I think they're still critical knowledge that every professional programmer should know. If you agree or disagree, I'd like to know. Drop a message into the Forum!

3 - Not every problem is a nail.
A favorite maxim of mine is, "When you only have a hammer, every problem looks like a nail." For the solution to this one, see rules one and two.

4 - Test, test, test. And when you're through, test some more.
In this example, we found errors in Microsoft documentation, inconsistencies in VB, and a few things that I didn't understand well enough. Even my friend missed a few things that were actually found in testing.

5 - Move up to VB .NET !
My friend, a hard core "bits and bytes" sort of guy anyway, isn't completely on board with the need to move up to VB .NET. But most of the problems encountered here simply wouldn't have happened with .NET. I note that in the About Visual Basic VB .NET poll, the percentage of people voting for VB 6 is still over half, but it's starting to drop.

All in good time, my friend and other VB 6 programmers will see the light!

First page > Calculating a Contrasting Color Code > Page 1, 2, 3, 4 5, 6, 7

Explore Visual Basic

By Category

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Visual Basic

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

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

All rights reserved.