Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instr function in foxpro
Message
De
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:
00763139
Vues:
36
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...

>>That's simply a matter of opinion based on what the observer is used to and not some kind of hard fact. Is 1=1 less readable than 1 = 1? There's more important things to worry about when coding than that.
>
>Mike,
>
>I hate to disagree here, but I have to. Including spaces does make the code more readable. When I, many years ago (1986-87), was studying Computer Science in college, we were told from the outset that if we didn't adhere to the spacing format, we'd get the assignment back with "Do over!" written in red on it. Your example is a simple one. More complex formulas yielding a much better example
c=SQRT(a^2+b^2)
or
c = SQRT(a ^ 2 + b ^ 2)
The thing that I believe is that readability isn't a small thing. It's a big thing. If it ain't readable, it ain't maintable. Maintenance is where the bulk of the cost of any system is.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform