 |
| Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 14th, 2007, 11:35 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
"Big bang" coding is very bad, which I imagine is what was done here, else you would of learned of this problem long before you got to this point.
While I understand that "all lines are required" why can you not break these required lines out into funtions or routines?? Surely there is a more effecient way to organize/optimize your code.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|
|

March 14th, 2007, 01:53 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Big Bang is something I learned in my very first Programming class at school. Our professor used Big Bang as a definition for going through and coding an entire Application without testing so when the programmer went to compile the app, it either worked or it didnt.
Of course this came up during his lecture about unit testing and debugging, but the term "Big Bang" always stuck with me. ^^
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|
|

March 14th, 2007, 03:57 PM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I like that, and I'll use that term whenever I see this happening from now on. I often take on side jobs of doing code reviews, and I see code that looks like this often.
Personally, I unit test, but even long before unit testing as it now is commonly done I rarely ever wrote more than a line or two without at least compiling, and attempting a test of some sort. My brain just doesn't work well enough to think any further ahead than that. However, I did work with someone who would write hundreds of lines of code (much of it by copying and pasting) and then spend endless hours debugging it. It seems impossible that someone would do that more than one time but this guy did it constantly. I prefer the continuous feedback that TDD provides, and the process of thinking about how a method or line of code will be used and tested before writing the code.
Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
|
|

March 14th, 2007, 04:16 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
it reminds me the beginning of time... just afte rthe Big Bang... when we had to punch hundreds of cards, taking them to the Computer Center, wait for a technician to collect them, and wait again for the result in the form of a printout. If the printout was only two pages we knew what it was: "compile error at line 230...". Restart from zero, change the 230th card (and what was goinf with it), take the whole bunch again in the Compiter Center... few hours wasted again
I am like woody: as soon as I finished few lines of code I press Ctrl+F5 to start with a full compile (or Ctrl+Shift+B if I am using .NET)
Balakrishna, when the code is long enough that it does not fit the IDE window, for me it means it is time to split it and write another procedure... But your case (write the same record in multiple table) seems easily solved writing a procedure that writes a record in a "generic" table, and that takes the table (and the record) as a parameter. You call that 35 times passing record and table, or you put the tables in an array and use a for loop. And presto, the code from 2500 lines is reduced to 200 (unless you are paid by lines of code you write, like in the past, just after the Big Bang :) I am joking of course)
"There are two ways to write error-free programs. Only the third one works."
Unknown
|
|

March 14th, 2007, 04:33 PM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Good point! I would like to be paid for each line of code I DON'T write. For example, in the code of the OP I would be paid for 2500 - 200 lines, which is 2300 lines of code I didn't write that I could be paid for. The fewer the lines of code, the easier to debug, the easier to decouple, the easier to encapsulate, and so on. Oh well, at least I get paid by the hour.
Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
|
|

March 14th, 2007, 04:37 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
....I don't think id have to work another day in my life if i got paid for the lines of code I didn't have to write.
I, unfortunately, don't get paid by the hour. =[
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|
|

March 14th, 2007, 08:26 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
well, no one here is paid by the hour... I have to sign for 8 hours per day, but they are 10 more often than 6 :)
I would leave this company right away if they measure my productivity by lines of code! Everyone is capable to write 10 thousands lines of bad code...
"There are two ways to write error-free programs. Only the third one works."
Unknown
|
|

March 15th, 2007, 07:00 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
Quote:
quote:Originally posted by marcostraf
Everyone is capable to write 10 thousands lines of bad code...
|
That is one of the most true statements I have ever read. And I know what you mean, I sign for 8 but my days are often much longer!
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
|
|

March 15th, 2007, 09:46 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey Doug and Marco,
I don't actualy get paid by the hour on my daily job - since I, too, am "salaried". But I never work more than an 8 hour day except when there is a big emergency - and then I make a point of getting those hours back at the first opportunity. For example, if I end up working late tonight because the build machine blue-screens, then I will tell my manager tomorrow that I am leaving early to make up for last night. If I couldn't do that, I'd polish up my resume and look for another job. On the other hand, if I mess something up I'll make it right even if it takes a little overtime - however, I work hard at never messing anything up.
Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
|
|
 |