Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instr function in foxpro
Message
 
À
07/03/2003 19:25:48
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00761834
Message ID:
00763151
Vues:
38
>Hey George
>
>All I contend is that "readable" is the opinion of each person who looks at the code. You can't disagree with that!
>
>I don't disagree with making things readable. I just don't see the point in telling someone what I think is readable is what they should think is readable. I do think good spelling makes things readable. Just try to get away with
c=srqt(a^2+b^2)
;)
>
>Breaking code/methods/class libraries up into logical pieces does more for maintenance/readability than inter-character spacing.
>
>I don't see one of your examples as better than the other. In fact, I think this is more readable
c=sqrt(a^2 + b^2)
because each item being squared is clearly identified by having the carat touching both of its elements. The formula is broken up into its logical pieces by the spaces.
>
>IMO extra spaces makes that harder to see. If extra spaces are good, why not do this?
c  =  sqrt  (  a  ^  2  +  b  ^  2  )
;) Now you don't want extra spaces right? ;)
>
>Too many people are wasting too much time worrying about "readability". I remember watching in dismay as someone wasted time changing tabs to spaces by hand without using search and replace or keyboard macros all because that person thought it was more readable. The fact is there was little gain.
>
>Speaking of wasting time...

Hiya Mike,

One thing I do, and have for a long time, is that when I'm presented with new code, I go through it, line by line. Along the way, I'll reformat the code if necessary.

Way back when QB 3.0 was out, I noticed that the editor automatically changed statememts like:a=b+c to a = b + c. At that point, I became convinced that if MS was going to go to the trouble to write code to automatically do it, then there must be some value in it. In fact, to this day, .NET does the same thing.

Several years ago, I asked my current supervisor if she would spread out her code in a similar manner. When she asked why, I said, "To make it more readable." She replied, "Well, I can read it fine."

The problem is, and was, not everyone has the advantage of having written the code they're charged with maintaining. What was easily readable to her, wasn't by me. By adhering to standards like this one, you not only help yourself, but whomever has to maintain the code as well.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform