Avoiding code troubles

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jul 2008
Posts: 27
Reputation: deftones is an unknown quantity at this point 
Solved Threads: 0
deftones deftones is offline Offline
Light Poster

Avoiding code troubles

 
0
  #1
28 Days Ago
Hi again,

I have a huge code written, but I'm not even halfway there. Had to split couple of procedures to make everything work smoothly etc. I was wondering, would it be reasonable to put some of my code into modules, in order to avoid compiling or similar errors in future?
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 832
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 152
vb5prgrmr vb5prgrmr is offline Offline
Practically a Posting Shark
 
0
  #2
28 Days Ago
Yes...

For readability, I try to keep my subs and functions as small as possible. So, if I can break a piece of code out and put it somewhere so I can call it, then so it is done. If there is a piece of code that I keep repeating, I try to figure out a way to make it more general so I can encapsulate it into sub or function. So, break it out, put it in a module or even within the same form if necessary but above all don't forget to document it!



Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 27
Reputation: deftones is an unknown quantity at this point 
Solved Threads: 0
deftones deftones is offline Offline
Light Poster
 
0
  #3
28 Days Ago
Well, my intention is usually the same, I mean I try to optimize the code. But it's quite a task for me, since I do not have enough experience to do that. Even though I sometimes spot some repetitive lines, but it's like I can't do much about it. But I guess practice makes perfect. Anyway, thank you once again, I'll have your advises in mind.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC