473,395 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Advice on VBA Comment Style

Hi there,

I'm trying to sharpen up my commenting in my code, partly for my own
sake and partly for any inheritors of my code. I'm particularly
wondering what comments are recommended for the beginning of each
procedure.

Can you point me to a site that gives advice on good commenting style,
or post some pearls of your own wisdom? My searches in the
newsgroup/mvps.org/google didn't go too well - searching for "comments"
casts the net rather too wide! :-)

-------
LoopyNZ
-------

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
2 6934
Not sure there is much of a standard, but the minimum would be:
'Purpose: Avoid division by zero error.

If a function, explain what it returns:
'Return: Result of division, or zero in place of error or null.

If it accepts arguments, an explanation of each:
'Arguments: Num1 = numerator
' Num2 = denominator

If usage is not obvious, give an example of how it is used:
'Usage: Set AfterUpdate event of form to:
' Call NotifyCombos(acDeleteOk)
' and AfterDelConfirm event of form to:
' Call NotifyCombos(Status)

If there is something odd about how the procedure works, you may want to
explain the method:
'Method: Handles #1/1/9999# as last effective date.

If there is somehing odd about what it depends on note that also:
'Dependency: Requires functions from our ExtraLib.mda file.

In a multi-user environment, you may also want to specify the author, though
it may be better to keep each author's work in different modules.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"LoopyNZ" <Lo*****@NOguruSPPAM.net.nz> wrote in message
news:41**********************@news.newsgroups.ws.. .
Hi there,

I'm trying to sharpen up my commenting in my code, partly for my own
sake and partly for any inheritors of my code. I'm particularly
wondering what comments are recommended for the beginning of each
procedure.

Can you point me to a site that gives advice on good commenting style,
or post some pearls of your own wisdom? My searches in the
newsgroup/mvps.org/google didn't go too well - searching for "comments"
casts the net rather too wide! :-)

Nov 13 '05 #2
LoopyNZ <Lo*****@NOguruSPPAM.net.nz> wrote:
I'm particularly
wondering what comments are recommended for the beginning of each
procedure.


I include the following:

Author
Date
Purpose
Comments

Also include embedded comments as appropriate

Regards,
Keith.
www.keithwilby.org.uk
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Mackey | last post by:
hi folks, i'm puzzled over this one, anyone with some solid db experience might be able to enlighten me here. i'm modelling a file system in a database as follows, and i can't figure out to...
4
by: pcunix | last post by:
I'm looking for general advice, pointers to web pages, books, whatever. I have a moderately successful web site. The major complaint that I get, time after time, is "It's UUUGLY" As I have...
1
by: Chuck | last post by:
I am working with C# on Visual Studio 2003 SP1 on an XP professional SP2 system. All of the *.htm files generated by "Build Comment Web Pages" are flagged as restricted sites when I try to view...
18
by: pocmatos | last post by:
Hi all, While I was programming 5 minutes ago a recurring issue came up and this time I'd like to hear some opinions on style. Although they are usually personal I do think that in this case as...
6
by: patrick j | last post by:
Hi I've been testing out the "Conditional Comment" for IE. This is because for my web-site I want to have two style sheets, one for IE 6 and one for other browsers. Thus I hope to have my...
29
by: dbhbarton | last post by:
Had a thought that's grown on me. No idea if it's original or not- too inexperienced in programming- but I guess there's no harm floating it out there. Python wins big on readability, and...
11
Louis8
by: Louis8 | last post by:
I would be very appreciative of anyone who could show me a better way to do what I did. Complete newbee here. I have a comment form sidebar of blog. I wanted to Name & Comment fields required and...
0
by: karen987 | last post by:
Could someone please tell me what code to add here? I have a weblog, with daily news which readers can add comments to, which are stored in a database. The form to add the comments is on an ASP page,...
39
by: polas | last post by:
Afternoon all. I was just wondering about this point - I have (generally) used // for commenting a single line in C, but from looking at code other people have written it seems many use /* */...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.