Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Standards
Message
From
03/10/2003 05:50:25
 
 
To
26/09/2003 11:51:28
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
COMCodebook
Title:
Miscellaneous
Thread ID:
00832733
Message ID:
00834695
Views:
27
>Where can I find a document with some suggestions for good coding standards?
>
>I do not need a book, just a few simple rules for three programmers to work together and not get TOO messed up.

Here are some other IMO interesting layout items. The central theme is readability/scanability/understandability.
with thisform
   * 1:
   .cErrorMessages  = .checkAppExe( 'ABC.EXE' ) ;
                      + .checkRequiredFiles() ;
                      + .checkCompatibility()
   * 2:
   .cErrorMessages  = .checkAppExe( 'ABC.EXE' ) ;
                    + .checkRequiredFiles() ;
                    + .checkCompatibility()
   * 3:
   .cErrorMessages  = .checkAppExe( 'ABC.EXE' ) + ;
                      .checkRequiredFiles() + ;
                      .checkCompatibility()
   * 4:
   .cErrorMessages  = ''
   .cErrorMessages  = .cErrorMessages + .checkAppExe( 'ABC.EXE' )
   .cErrorMessages  = .cErrorMessages + .checkRequiredFiles()
   .cErrorMessages  = .cErrorMessages + .checkCompatibility()
endwith
I don't like case 1. Case 2 looks better than case 1. Case 3 is what I do a lot. Case 4 is what I do occassionally.
*   No spacing
ln1=val(left(lcT1,2))*3600+val(right(lcT1,2))*60

*   Spacing
ln1 = val( left( lcT1, 2 ) ) * 3600 + val( right( lcT1, 2 ) ) * 60
Ofcourse,spacingimprovesreadability. Ofcourse(spacing(improves(readability))).
*   Straightforward
lcC1 = ltrim( str( lnRec ) )
lcC2 = ltrim( str( int( lnRec / tnXis^3 ) % tnXis + 1000 ) )
lcC3 = ltrim( str( int( lnRec / tnXis^2 ) % tnXis + 1000 ) )
lcC4 = ltrim( str( int( lnRec / tnXis ) % tnXis + 1000 ) )
lcC5 = ltrim( str( lnRec % tnXis + 1000 ) )

*   Justified in a special manner
lcC1 = ltrim( str(      lnRec                            ) )
lcC2 = ltrim( str( int( lnRec / tnXis^3 ) % tnXis + 1000 ) )
lcC3 = ltrim( str( int( lnRec / tnXis^2 ) % tnXis + 1000 ) )
lcC4 = ltrim( str( int( lnRec / tnXis   ) % tnXis + 1000 ) )
lcC5 = ltrim( str(      lnRec             % tnXis + 1000 ) )
The differences between the formulas are much clearer if the special justification is applied.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform