Re: A Colon, in Visual Basic



On Wed, 29 Jun 2005 07:15:17 -0700, "Steve Gerrard"
<mynamehere@xxxxxxxxxxx> wrote:

>
>"J French" <erewhon@xxxxxxxxxx> wrote in message
>news:42c2640a.263681505@xxxxxxxxxxxxxxxxxxxxxxx
>> On Wed, 29 Jun 2005 08:51:41 +0100, "Ross" <Ross.Drew@xxxxxxxxxxxxxx>
>> wrote:
>>
>>
>> I can think of at least 10 programmers who see 'L9' and think - top
>> level loop.
>>
>
>Make that 11 now.
>
>I never noticed that there was a pattern in your L9, L8, ... variables. Like
>Mike, I just thought you were a little soft in the head :)
>
>Thanks for posting the expanation of the style. It does make sense now, even
>though it has that old school "punch card" feel to it.

You might be interested in another convention that came from the same
source.

For Private Subs in a module,
prefix their names with LS (for Local Sub)
eg: LS_CalculateTotalSalesValue( .. )

Ditto for Private Functions eg: Sum = LF_SomeCalc( .. )

For Subs that are 'Global' to a suite of EXEs within one Application,
but are of no meaning to any other type of App

Call GS_GetCustomerData( .. )

For Subs that can potentially be used by any App, but are not really a
'language extension', they are 'Universal Subs'

eg: USArSort( A$() ) ' sort the Array

Personally I regard such things as 'programmer utilities' while such
things as FileExists( Fle$ ) are an extension to the language.

The advantage of taking this approach is that one can get a very good
idea of the type of Sub or Function, also whether or not one needs to
take extra care when tinkering with it.

( BTW I'm not that keen on using the '_' in variable or procedure
names, but I'll do so if it makes the code clearer )

Another concept that you might find interesting is 'Code Combing'

One writes a routine, gets it working, then before moving on too far,
one goes back and keeps re-working the code until all obscurities have
been ironed out.

It actually pays off, because one can often find obscure problems,
also it makes it a heck of a sight easier when one goes back to the
same code six months later.

Also, when one is in 'frantic typing mode' one is just after getting
the result. Reviewing and reworking the code when one has it working
fine is a bit like 'snagging' after building work.
.



Relevant Pages

  • Re: A Colon, in Visual Basic
    ... > For Subs that are 'Global' to a suite of EXEs within one Application, ... > 'language extension', they are 'Universal Subs' ... > It actually pays off, because one can often find obscure problems, ... variables and procedures are named witout the ...
    (comp.lang.basic.visual.misc)
  • Re: DAO 3.6
    ... about the only thing I did different in my app was I disabled the ... > form when I loaded the second form, then enabled it prior to unload, and I ... > executed any subs in the Form_Activate sub of the main ... >> vbExclamation Or vbSystemModal, App.Title) ...
    (microsoft.public.vb.general.discussion)