|
-
May 4th, 2013, 10:37 AM
#10
Re: Commands executing in wrong order?
 Originally Posted by Signalman
For the ones that are not quite advanced with vb as others, what's wrong with DoEvents ?
Oh God I can write a book...I once wrote an app to do file transfers via TCP/IP in VB6. Now anyone who has any experience with network coding would tell you that threading is essential to making a quality network application. Only problem....VB6 doesn't allow multi-threading so the next best thing was DoEvents. The reetrancy problems I encountered caused so many problems, I was practically getting gray. While I eventually got it to work, it became one huge tangled mess of a program. What would have otherwise been an elegant application was such a butchered mess that even to this day I fear going near the source code. Just looking at the code gives me a headache.
I've learned the hard way just how malignant DoEvents can really be. Its ease of use gives you such a false sense of security. The problem with it is that you can easily forget that a single threaded application only has a single execution path. If you don't account for reetrancy, you can end up with one twisted call stack several levels deep which can place your program is such exceptional states that you can hardly account for all of them. And good luck trying to fix bugs cause by these conditions. I'm am telling you, DoEvents should have stayed in VB6 where it was a necessary evil.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|