Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Naming conventions again........
Message
 
To
28/08/1999 05:35:05
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00258085
Message ID:
00258786
Views:
17
>George,
>
>I totally agree and apply the same rules, Except;
>
>>2. The exit from any procedure/function/method always occurs at the last line of the procedure/function/method.
>
>In somecases I exit the proc when it contributes better readability. If in some cirsumstance it is needed to discontinue the proc before any other functional code in the proc (thus in the beginning of the proc). For example a Deleterecord event on a form:
>
>IF userHasNoDeletePermission()
> RETURN False
>ENDIF
>
>...
>...
>Other code to delete the record
>
>Regarding the naming conventions, I did clearly state I've got my doubts (and i still doubt).
>
Hi Walter,

I think the above is less readable than
IF NOT userHasNoDeletePermission()
  * Stuff to delete
ENDIF
RETURN llresult
and that it can make debugging harder depending on the circumstances. I'd be more likely to name the function UserHasDeletePermission() simply because the function would appear to be testing whether or not the user has permission. I realize that this is an example, but I'd design it that way. In others words, test for postive results and not negative ones.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform