Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Yoda coding styles
Message
From
21/04/2006 10:14:14
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01115355
Message ID:
01115374
Views:
10
>>Everytime I see someone else's code I'm left scratching my head.
>>
>>Take this line of code:
>>
>>Index Tag shiprate On province+Allt(city) Uniq
>>
>>
>>Besides the data modelling no-no of province and city in a table - permitting various incorrect spellings of province and city and impossible combinations of non-existant cities/provinces, and the questionable practice of having multiple shiprates per city+prov in the table only to ignore any but the first one, the code is written as if by Yoda.
>>
>>The help clearly shows
>>
>>INDEX ON eExpression TO IDXFileName | TAG TagName [BINARY]
>> [COLLATE cCollateSequence] [OF CDXFileName] [FOR lExpression]
>> [COMPACT] [ASCENDING | DESCENDING] [UNIQUE | CANDIDATE] [ADDITIVE]
>>
>>So while that line of yodacode works, it throws me for a loop. So I hereby request that we coin the term yodacode to apply to any yoda-like programmers.
>
>Good idea Mike. To add to your observation, I think that I will write all my code on one line so it will execute faster. Readability is not important when you want speed! :)

LOL! That's funny. I guess if it's someone's personal preference, it's OK?

If there is a physical, practical benefit to doing something it should outweigh personal preferences. Since there's no way a single line will execute faster, because the compiler will undo the semi-coloned lines entered by humans for humans - I don't think I'd do that. ;)
Previous
Reply
Map
View

Click here to load this message in the networking platform