Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The color of comments in your code window
Message
 
À
18/08/2009 15:05:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01418690
Message ID:
01418759
Vues:
70
Hi Craig,

>It would be self documenting and not need any comments if it read

If we are talking about .NET or Java, I agree. In VFP, however, it's not as easy, IMO, for a number of reasons:

1) VFP doesn't really support protected and hidden PEMs in the same way as others do. Using protected and hidden makes development more complicated. Intellisense does not hide any of these members. In .NET you only see those members that you can actually call. In other words, adding too many methods clutters the interface in VFP, but not in other languages.

2) Performance is a problem in VFP. A method call is significantly slower in VFP than executing a single line. This isn't the case with .NET or Java. While Performance shouldn't be the driving factor when writing code, it can be the deciding factor when multiple solutions exists. Using comments that form blocks in the code is an alternative solution in VFP.

3) Traditional VFP code relies on error handling. Error handling and status return values make it virtually impossible to write clean code, as every line would need to be accompanied by error checking code or nested IF/CASE statements. You need exception handling to write clean code.

4) VFP maintains an incredible amount of global status that we save and restore in procedures. The smaller you make a procedure the higher either the percentage of code that deals with global state maintenance, or the number of procedures that change global state. Both are not ideal.
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform