Go Back   Access World Forums > Access World > The Watercooler

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-15-2019, 11:54 AM   #16
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,718
Thanks: 93
Thanked 1,712 Times in 1,585 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: what's your most complex VBA code project?

Quote:
I have to try and fathom out what the hell they were trying to achieve...
This is exactly why when I was a development team leader three jobs ago that I told my team we were going to make code one day and if it tested OK, we would document it immediately after the test. AND where lines of code were involved in a way that would allow comments, we would place comments on no less than 50% of the lines. There were rules about meaningful comments and sometimes I would have to counsel them on leaving a useless comment.

Adam, you are correct that Excel allows folks to be sloppy. But sadly, so does any other system of development tools. Excel has no monopoly on that fine point. But I absolutely don't disagree with you on the tendencies to "shoot from the hip" and "damn the torpedoes, full speed ahead" mentalities.

Programming and developing robust, useful apps will require thought, not reckless advance. We are code commandos, not barbarian warriors rushing a barrier. We PLAN our way into a problem and take it down by well-selected actions. We don't bash in the door and tromp all over things. (Well, most of us don't...)

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 11-17-2019, 03:53 PM   #17
Galaxiom
Super Moderator
 
Join Date: Jan 2009
Location: NSW Australia
Posts: 11,710
Thanks: 105
Thanked 1,511 Times in 1,424 Posts
Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold Galaxiom is a splendid one to behold
Re: what's your most complex VBA code project?

Quote:
Originally Posted by The_Doc_Man View Post
AND where lines of code were involved in a way that would allow comments, we would place comments on no less than 50% of the lines. There were rules about meaningful comments and sometimes I would have to counsel them on leaving a useless comment.
With a requirement to place comments on half the lines I'm not surprised you got useless comments.

I cannot stand comments like:
' Increment counter
' Set value on variable
' Test for EOF
' Close Form

Excessive commenting makes code harder to read. Well structured code is largely self documenting.

I would much rather see a few lines of comments at the top of a sub or block of code explaining what it does.
Galaxiom is offline   Reply With Quote
Old 11-17-2019, 04:02 PM   #18
Micron
AWF VIP
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 1,228
Thanks: 10
Thanked 231 Times in 219 Posts
Micron has a spectacular aura about Micron has a spectacular aura about
Re: what's your most complex VBA code project?

Quote:
Originally Posted by Galaxiom View Post
Excessive commenting makes code harder to read.
Amen to that.

__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 11-17-2019, 04:45 PM   #19
vba_php
Software Engineer
 
vba_php's Avatar
 
Join Date: Oct 2019
Location: Iowa City, IA
Posts: 589
Thanks: 74
Thanked 63 Times in 63 Posts
vba_php is on a distinguished road
Re: what's your most complex VBA code project?

Quote:
Originally Posted by Galaxiom View Post
Well structured code is largely self documenting.
true, but good developers will create separate documents to explain the project flow anyway.
vba_php is offline   Reply With Quote
Old 11-17-2019, 05:49 PM   #20
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,365
Thanks: 555
Thanked 948 Times in 897 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: what's your most complex VBA code project?

Quote:
Originally Posted by vba_php View Post
true, but good developers will create separate documents to explain the project flow anyway.
I recently coded a payment collection form with discounts at certain levels, discounts for club members, refund on canclation, but only if cancelled within 48 hours, and a couple of other special cases.
I coded it lovely, it all worked!

Went back to it a week or so later and it had me scratching my head! I always put comments in, to help me follow my own logic, but in this particular case it was so involved that there was no way just commenting could convey what was going on.

When you are in the zone coding, you can just bash it out, but looking at it later, I found it difficult to to understand what I had done. It took me nearly as long to draw up some flow charts and a presentation explaining it!

I know if I don't get the explanation of what I was thinking down somewhere, if I have to revisit it at a later stage it will take me forever to sort it out.



Sent from Newbury UK
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 11-17-2019, 08:53 PM   #21
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,718
Thanks: 93
Thanked 1,712 Times in 1,585 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: what's your most complex VBA code project?

After a while, I settled for "paragraph" comments at the beginning of any sequence. But if there was any crucial moment where an answer had been developed, I demanded that it get a special comment.

I also told my people that we would have a project "bible" - which we did - to tell us what we had agreed to do in any section, and the rule was that a design change that altered the description of the section (as opposed to bug fixes that didn't change intent) HAD to be reviewed by the group for understanding and agreement that it was (a) effective and (b) necessary or at least appropriate. Bug fixes, we could make and just document in code and in a patch history document.

In retrospect, I wasn't as nice to my team back then as I might have been. However, I stayed friends with all but one of them.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 11-17-2019, 08:59 PM   #22
vba_php
Software Engineer
 
vba_php's Avatar
 
Join Date: Oct 2019
Location: Iowa City, IA
Posts: 589
Thanks: 74
Thanked 63 Times in 63 Posts
vba_php is on a distinguished road
Re: what's your most complex VBA code project?

Quote:
Originally Posted by The_Doc_Man View Post
the rule was that a design change that altered the description of the section (as opposed to bug fixes that didn't change intent) HAD to be reviewed by the group for understanding and agreement that it was (a) effective and (b) necessary or at least appropriate.
when i worked for rockwell collins (now collins aerospace), we had a review application written using DOS batch files and it didn't matter how small a code change was, we had to put a description in the application, print out the old code, the new code, a description of the change and why it was changed. that old and new code was then passed to every person on the team and they were required to review and sign off on it. if any part of the change was questioned by another team member, the developer who wrote it had to review the comments or questions and repeat the entire process all over again.


that company worked with critical software though: embedded systems that guided commercial airplanes, ran military equipment, etc... we also had numerous government documents for which there were development requirements we were bound by. that was the best job i ever had, but it was the worse at the same time.


vba_php is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with complex macro or code KellyADnvr Macros 3 08-09-2012 08:26 AM
Complex "notes" project and i am so lost... simpleton General 7 07-09-2008 12:16 AM
complex(?) code? Matizo Modules & VBA 6 02-01-2007 11:37 AM
Complex Example Code in MS Help Files mamandeno The Watercooler 8 01-31-2007 11:57 PM
complex code for a form Jade Modules & VBA 1 06-27-2001 07:37 PM




All times are GMT -8. The time now is 04:19 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World