Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP IDE stinks at finding bad variable names in my code
Message
From
28/06/2009 19:33:39
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01399931
Message ID:
01408957
Views:
79
>>> Seems to be cathing a wave or something in the community.
>>
>>On the other side there's currently a movement to make variable names short and meaningless. The reasoning behind this is that the context in the method and the method name is explanation enough to make it obvious what the variable is used for. If the context isn't clear the method is too long and needs refactoring, anyway. I came across an article explaining this more in detail a couple of months ago, but I can't find the link right now...
>
>An article espousing meaningless variable names? I have not read it but am skeptical. I had the misfortune of supporting one application whose author used short, cryptic names and they were the bane of my existence. He named every temporary table Rob, Rob0, Rob1, etc. Good luck figuring out what anything was.
>
>And not a comment anywhere in the application. No wonder every bug took twice as long as you thought it would.

There is a whole school of thought that "all comments are lies" - usually also extended to Hungarian Notation (HN) and any sort of long, "descriptive" variable names. Anyone who's maintained an app written by someone else has gone on wild goose chases, or otherwise been burned by bad comments.

I like Christof's example for generic functions. Discussing that a little further I can see cases where it would be easier to spot variable references in code if they are short and distinct (e.g. xxx, yyy, zzz) rather than SomeMeaningfulVariableName1, SomeMeaningfulVariableName2 etc. I've seen *way* too much of the latter.

I still comment critical business logic, and other unique code.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform