Chuck wrote:Sure it's a convention in C++ and Java, but it's exhibited by *thousands* of source files. If you joined a Java developer shop and started declaring capitalized methods they would immediately correct you, just like if you didn't indent your code blocks.
But won't the .NET community at large feel the same way when they see Console.WriteLine spelled Console.writeLine?
Actually since making my last post I've been reading the "Design Guidelines for Developing Class Libraries" document here:
http://msdn.microsoft.com/en-us/library/ms229042.aspxAs usual the issues are more complicated than they at first appear. I see that the .NET Framework is intended to support both case sensitive and case insensitive languages. Thus one is not supposed to create public names that differ only in case even if one's language would allow it. This issue actually comes up for Ada since that language is, in fact, case insensitive. Thus in an Ada program it must be possible to make a call such as Console.writeline("Hello") since the casing of "writeline" is not allowed to be significant. On the other hand, the industry wide naming convention in the Ada community uses underscores to separate words. Thus Console.Write_Line("Hello") has a more "Ada-like" look. Nevertheless GNAT for .NET does not attempt to convert Write_Line to WriteLine for the sake of making such a call possible. When invoking .NET libraries, .NET names are used (not considering differences in case, as per language requirements).
Cobra is case sensitive so my expectation was that I would have to spell the .NET names *exactly* as they are documented. It was a surprise to find out that doing so causes an error!
Chuck wrote:Regarding Cobra, I do think it's desirable to enforce a consistent coding convention.
I'm all for consistent coding conventions. I even support compiler enforced consistency (in looser languages I've used style checking tools for exactly this purpose). I don't think requiring lower case method names (for the initial letter) in Cobra is a horrible thing, and I can certainly live with it. However, I do think that for the sake of enforcing a particular (somewhat arbitrary) convention inside the Cobra language you've introduced a quirky inconsistency with the rest of the .NET universe.
Chuck wrote:If it helps any, I do plan on implementing case correction for members at some point. (Or would accept a patch.)
What do you mean by "case correction?" Does that mean the language would treat members in a generally case insensitive manner? That could be cool. That would be easy to understand and play well with the .NET philosophy. Would that mean it would be an error to create two members with names differing only in case? I like that idea.