Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which Is More Readable To You?
Message
From
06/03/2008 07:40:10
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01298471
Message ID:
01299254
Views:
23
>>The topic is unresolvable if even the "experts" can't agree on it. We should be free to write our own way and we should be evolved enough to accept everyone's way. :)
>
>But you're the one who's always so big on programming being scientific, best practices, and such. Not that I'm against that, but it can also be applied to how code is formatted. I wouldn't want to go too far - you can allow some flexibility - but many things improve readability, understandability, and maintainability. I try to write code that works with the brain not against it. And this means making the code look like the English that we've read since childhood (sorry to all you non-native English speakers). So punctuation is like what we see in a book or magazine: spaces around operators, parenthesis next to the characters (no space after the parentesis), etc. Camel case to help reading MultiWordVariables. I tend to use lined up REPLACE statements like the one that started this thread, but more so when it gets big. With just 2 or three lines I tend not to worry about it, so I'm a bit inconsistent in that area, but the bigger the statement is, the more the lining up is
>helpful. Anyway, you can't be a Nazi about it - as I believe you mentioned in one post - but enforcing some reasonable formatting standards helps greatly.

Perhaps I should have said free to *format* anyway we want. There is no consensus. I agree with everything else you said.

There should be commenting standards. As to coding practices, we should agree on things that have a physical effect.

This is easier
SCAN
  commands...
ENDSCAN
than this...
DO WHILE NOT EOF()
commands...
if alias()#"somealias"
  select somealias
endif
if not eof()
  skip
endif
ENDDO
This will never crash...
m.a = m.a + 1

where this could...
a = a + 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform