Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft launches new open source codeplex foundation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01424841
Message ID:
01427046
Vues:
86
>>>>>That's a hoot. In 20 years of programming, during which time I have followed up behind a number of programmers, I've never found myself - not even once - worrying about the case of variable names. This issue is so low on the priority list as to be nonexistent. The problems are usually things like a lack of understanding about data normalization, SQL, granularity, boolean logic, and on and on. Once I followed up behind someone that had written what was far and away the worst program I've ever seen. He smashed every rule in the book. It was astounding how bad it was. Not only bad, but there was some really weird "techniques" (if you could call them that) that he used. If you could invert that - make it a great programming example instead of a horrible one - but leave in case inconsistency in his variables, etc. then I wouldn't have a care in the world. I wouldn't criticize it even one billionth of a percent. Could someone make it painful. SuRE tHEY couLD If ThEy WANted To BUt YOU Won'T FinD thAT. It's mainly minor discrepencies.
>>>>>
>>>>>Another example: Case-sensitivity in Linux. They brought it over from the programming environment, mistakenly thinking what a great thing it is. You know what they have to do in order to get regular people using Linux. They have to remove it so that when you search for a file name, you don't have to have the case exactly right. Imagine some CEO or CIO looking for the some document related to the big presentation and he/she can't find it because when he typed it into the search field, he didn't use the same case. Do you think Linux would ever get into or stay in that corporation after that? No, he'd never let it in or toss it out and he'd find (or would like to find) the programmers that made that idiotic decision and rip their heads off and defecate down their necks. So the smarter programmers remove that issue from their search tools. And that is probably the best reason not to have it. If it's a problem that needs to be worked around, it's better to fix the root cause than treat the symptoms. Case-sensitivity should have never been invited to the party.
>>>>
>>>>Personally I *much* prefer case sensitive languages. One neat feature in VS2010 which couldn't exist if C# wasn't case sensitive is the QuickFind for types which relies on camel casing. Searching for, for example, "MC" will bring up all types such as
>>>>MyCustomProperty, MyCustomClass, MyCustomMethod etc....
>>>
>>>This implies that you are letting case render meaning, which I would consider a very bad technique. Perhaps that's not what you meant, however.
>>
>>MS guidelines for .NET recommend Pascal casing for Class, Method, Property,Interface and Event names and NameSpaces.
>>Why would you consider it a bad technique?
>
>Do you mean CamelCase? I programmed in Pacal in college, but I'm not sure when this became known as Pascal casing. I consider it a bad technique when the simple case of a variable (or whatever) indicates something. Our brains don't differentiate that. I could refer to you as viv and you might prefer Viv, but you'd know it was you to whom I was referring. You could, in a case sensitie language, make S and s variable names and they'd be different, but it'd be bad technique. Perhaps I'm still not understanding what you're getting at, but imparting meaning via the case of a variable name is a stupid idea regardless of who came up with it.

Camel case has a lower case first letter: But do you really think sendemailmessagetoviv is more readable than SendMailMessageToViv? (one of my pet peeves with VFP was it's insistence on translating method names to lower case for no reason)
It's also common to see camel case used for private variables - in fact backing fields often have the same name (differing only by case) as their public counterpart. E.g:
public string SomeProperty
{
//////
}
private string someProperty;

Personally I like this construct - it's easy to identify the link between the two names elsewhere in code.

Regardless of whether you think it is stupid probably 95% of NET code follows the general convention - can you point me to a single example on the web that doesn't? AFAICS the MS guidelines (http://msdn.microsoft.com/en-us/library/xzf533w0(VS.71).aspx) are pretty generally followed - not because MS say so but because they make sense. I seriously doubt you would get a job in a .NET shop without complying.

Regards,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform