| | |
Avoiding code troubles
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Mar 2009
Posts: 832
Reputation:
Solved Threads: 152
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
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
Thanks
•
•
Join Date: Jul 2008
Posts: 27
Reputation:
Solved Threads: 0
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.
![]() |
Similar Threads
- how to make typing tutor software in c (C)
- Help With My C++ Assignment (C++)
- Assigning a dynamic array to a vector (C++)
- write to an Exel file (PHP)
- c++ serial port collector (C++)
- Preprocessing data. (Java)
- Poisson distribution (Pascal and Delphi)
- malloc of a two-dimensional array (C)
- Pascal calculator program (Pascal and Delphi)
- How do I...call other programs? (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: simple question (Form1)
- Next Thread: How to run a program in a remote machine
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





