[AccessD] Naming Conventions

Charlotte Foust cfoust at infostatsystems.com
Tue Aug 10 15:23:17 CDT 2004


I never dim variables anywhere except at the top of a routine.  Then I
always know where to look to see all the variables and constants
declared in that routine.  I hate having to track them down in the code
... Especially if someone falls into the dim i as integer pit!  Looking
for variables declared in the body of code is like looking for a needle
in a haystack, and you're much more likely to screw up your code by
moving something that uses that variable to before the declaration if
you declare it in the body of the routine.

Charlotte Foust


-----Original Message-----
From: Hale, Jim [mailto:Jim.Hale at fleetpride.com] 
Sent: Tuesday, August 10, 2004 11:02 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Naming Conventions


Do you always dim your variables at the top of the routines? I got in
that habit sometime ago but it occurs to me 
"dim i as integer" at the start of a loop might solve the "what type is
it" issue.

Jim Hale

-----Original Message-----
From: Charlotte Foust [mailto:cfoust at infostatsystems.com]
Sent: Tuesday, August 10, 2004 10:30 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Naming Conventions


Yep.  I do it, and my boss hates it, although the other developers
appreciate it.  My boss feels that that extra green text makes the code
*hard* to read and is unnecessary is short routines.  My feeling is that
I never know what might get inserted into the middle and it's easier to
keep track if you comment the code when you write it.  I had an
instructor who insisted on this kind of commenting even for declarations
and at the end of a function or sub.

Charlotte Foust


-----Original Message-----
From: Scott Marcus [mailto:marcus at tsstech.com] 
Sent: Tuesday, August 10, 2004 3:21 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Naming Conventions


I forget who mentioned something like this...

If I < 90 Then
   'some code here
End If 'I

but I SOMETIMES do the following in complex code...

If intEmployeeType < ADMINISTRATOR Then
   'some code here
End If 'intEmployeeType < ADMINISTRATOR

Anyone else do this?

I usually just break up the complex code into functions/procedures.

Scott Marcus

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list