Hi All,
Other programming best practices aside, please keep this one in mind:
Always program like the maintenance programmer taking over your work is a murderous psychopath who knows where you live.
Well, I am that maintenance programmer, and I am determined to find out where you live. Earlier this week an interesting change request popped into my queue: "[tool name removed] needs upgrade" said the request title. Not too bad, you think? Just take a tool and add whatever features required? Why are you so angry?
I think in some cases a few numbers can tell more than a thousand words:
85.022 Code lines
7.421 Code lines in single form constructor
657 On Error Resume Next statements
359 Public variables
242 Comment lines (most of which is commented out code)
52 Forms
17 Procedures (not counting form/control event handlers)
1 Public variable called "sWhatever" - type Long
1 code module (!)
1 home-rolled ActiveX control with no source code available that does something, but not sure what.
1 too many CopyMemory API calls for my taste.
1 man to refactor this whole abortion and convert it to .NET, with
0 patience for bad code.
So just remember, don't ever do this