I sometimes despair of MS [modified Someone, sort of, agrees with me]
-
I suspect a lot of this is due to churn, the penchant for hiring post graduates thinking they are smarter than everyone else and bored programmers who are either doing just enough to keep their jobs or trying to find excuses to do something new to pad their resume. Oops, I pretty much defined the industry as a whole. Back to Microsoft--at the very least, they need to find the guy or gal who does the dialogs for Visual Studio and give them a whipping. Then find the idiot who keeps rejected bug reports about badly designed dialogs in Visual Studio and invite them to try a different career.
Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
Joe Woodbury wrote:
the guy or gal who does the dialogs for Visual Studio and give them a whipping
Bit of a sore point?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Back in 2003 when I jumped the Delphi ship for C#, one of the first things I did was to read the Framework Design Guidelines, although I think it had a different name back then. As far as I could, for someone learning a new language, I tried to stick to those conventions. I have just started experimenting with Entity Framework, which seems to be a quite useful thing, and I am astonished at the divergence from its own standards in the code generated. How on earth do MS expect people to follow its guidelines when its own developers don't? Are they unaware of FXCop? I think MS should immediately adopt a policy for its own developers, that all code released should pass the FXCop test, and that includes generated code. I am not advocating that all developers should adopt this style, an ingrained C/C++ dev naturally falls into their familiar style, but there is no point in MS publishing standards if they don't follow them. [MOD] Just found this article[^] "But the way that the Windows 7 UAC "improvements" have been made completely exempts Microsoft's developers from having to do that work themselves. With Windows 7, it's one rule for Redmond, another one for everyone else." [/MOD]
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
modified on Saturday, March 7, 2009 2:01 PM
Exactly what rules are you talking about?
-
Exactly what rules are you talking about?
Just little things like: Do not use a prefix for member variables (_, m_, s_, etc.). If you want to distinguish between local and member variables you should use “this.” in C# and “Me.” in VB.NET. Do use camelCasing for member variables Do use camelCasing for parameters For some reason things like
private int _AnInt = 0; (should be - private anInt = 0; )
public int AnInt
{
get
{
return _AnInt; (should be - return this.anInt; )
}set { \_AnInt = value; (should be - this.anInt = value; ) }
}
drive me ablolutely nutso. As I said previously I can understand that non-MS developers might use other conventions. MS, however, should stick to the rules that it published itself.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Just little things like: Do not use a prefix for member variables (_, m_, s_, etc.). If you want to distinguish between local and member variables you should use “this.” in C# and “Me.” in VB.NET. Do use camelCasing for member variables Do use camelCasing for parameters For some reason things like
private int _AnInt = 0; (should be - private anInt = 0; )
public int AnInt
{
get
{
return _AnInt; (should be - return this.anInt; )
}set { \_AnInt = value; (should be - this.anInt = value; ) }
}
drive me ablolutely nutso. As I said previously I can understand that non-MS developers might use other conventions. MS, however, should stick to the rules that it published itself.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Are you talking about stylecop or fxcop? Fxcop does not inforce any rules on private members as is the case with you. Stylecop has an option that allows You to disable checking for generated code.
-
Are you talking about stylecop or fxcop? Fxcop does not inforce any rules on private members as is the case with you. Stylecop has an option that allows You to disable checking for generated code.
You could be right. I may well be confusing the two. That does not, however, negate my point. If MS publishes rules for things like naming conventions and the like, it should stick to them.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Back in 2003 when I jumped the Delphi ship for C#, one of the first things I did was to read the Framework Design Guidelines, although I think it had a different name back then. As far as I could, for someone learning a new language, I tried to stick to those conventions. I have just started experimenting with Entity Framework, which seems to be a quite useful thing, and I am astonished at the divergence from its own standards in the code generated. How on earth do MS expect people to follow its guidelines when its own developers don't? Are they unaware of FXCop? I think MS should immediately adopt a policy for its own developers, that all code released should pass the FXCop test, and that includes generated code. I am not advocating that all developers should adopt this style, an ingrained C/C++ dev naturally falls into their familiar style, but there is no point in MS publishing standards if they don't follow them. [MOD] Just found this article[^] "But the way that the Windows 7 UAC "improvements" have been made completely exempts Microsoft's developers from having to do that work themselves. With Windows 7, it's one rule for Redmond, another one for everyone else." [/MOD]
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
modified on Saturday, March 7, 2009 2:01 PM
Henry Minute wrote:
With Windows 7, it's one rule for Redmond, another one for everyone else."
One O.S. to rule them all, one search to find them, one desktop to bring them all, and in the darkness bind them.
Software Zen:
delete this;
Fold With Us![^] -
Henry Minute wrote:
With Windows 7, it's one rule for Redmond, another one for everyone else."
One O.S. to rule them all, one search to find them, one desktop to bring them all, and in the darkness bind them.
Software Zen:
delete this;
Fold With Us![^]Gary R. Wheeler wrote:
One O.S. to rule them all, one search to find them, one desktop to bring them all, and in the darkness bind them.
Weven does sound like it ought to be a river/village in Middle Earth. Doesn't it?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
You could be right. I may well be confusing the two. That does not, however, negate my point. If MS publishes rules for things like naming conventions and the like, it should stick to them.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Henry Minute wrote:
If MS publishes rules for things like naming conventions and the like, it should stick to them.
MS Does follow FxCop rules well. You will find that all the new MS development after FxCop was developed follow these rules. StyleCop is a new thing and it does not have any strong backing. Also StyleCop is not meant to be followed for generated code anyway, I believe the default options are turned off for that.
-
Marc Clifton wrote:
You could, probably, generate your own FXCop-compliant code from the EDM's XML
That's probably true. It would certainly be quicker than attempting to do it in the Editor. I haven't got round to looking at the XML yet. However, that would get me off on another rant about the .NET code generation classes and their inability to, amongst other things, deal with line-breaks properly. :laugh: [MOD] BTW, I started my exploration of EF with your Intro to EF article. [/MOD]
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Henry Minute wrote:
BTW, I started my exploration of EF with your Intro to EF article.
:cool: Marc
-
Henry Minute wrote:
If MS publishes rules for things like naming conventions and the like, it should stick to them.
MS Does follow FxCop rules well. You will find that all the new MS development after FxCop was developed follow these rules. StyleCop is a new thing and it does not have any strong backing. Also StyleCop is not meant to be followed for generated code anyway, I believe the default options are turned off for that.
I have done a little research since your last post and have discovered that I was not confusing FXCop and StyleCop. I said FXCop and I meant FXCop. So that you are aware of the research that I did, I will tell you what it was. I took my brand new copy of 'Framework Design Guidelines Conventions, Idioms, and Patterns for Reusable .NET Libraries' out of the wrapper it arrived in, and read it. Page 372. B.2 The Evolution of FXCop Para 1. Line 6 onwards. "In addition to enforcing the Framework Design Guidelines" (my emboldening) Page 368. 3rd rule "DO use camelCasing for local variables" (their emboldening) So there immediately is one rule that the generated code breaks. The point that StyleCop does not check generated code is true (<autogenerated> tag in header). To some extent that makes sense, but only because it would be difficult to enforce for third party tools. For In-House tools, generate the code, edit out the 'autogenerated' tab and whack the thing through FXCop and/or StyleCop. Repeat until done. Then, and only then release the tool. To say that it doesn't count because it's generated code is anarchy. Any development group inside MS could then stuff anything they felt like in a generated file. Brad Abrahams in his 'Coding Style Guidelines' document said "The reasons to extend the public rules (no Hungarian, no prefix for member variables, etc.) is to produce a consistent source code appearance. In addition a goal is to have clean readable source. Code legibility should be a primary goal." That is as valid for MS 'generated' code as for any other code they produce. End of! No ifs, ands or buts. If they are going to have rules they should stick to them, for all in-house code. If they are incapable of doing that, that tells us a lot about what to expect from any of their products in the future. :mad: :rolleyes: :zzz:
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
I have done a little research since your last post and have discovered that I was not confusing FXCop and StyleCop. I said FXCop and I meant FXCop. So that you are aware of the research that I did, I will tell you what it was. I took my brand new copy of 'Framework Design Guidelines Conventions, Idioms, and Patterns for Reusable .NET Libraries' out of the wrapper it arrived in, and read it. Page 372. B.2 The Evolution of FXCop Para 1. Line 6 onwards. "In addition to enforcing the Framework Design Guidelines" (my emboldening) Page 368. 3rd rule "DO use camelCasing for local variables" (their emboldening) So there immediately is one rule that the generated code breaks. The point that StyleCop does not check generated code is true (<autogenerated> tag in header). To some extent that makes sense, but only because it would be difficult to enforce for third party tools. For In-House tools, generate the code, edit out the 'autogenerated' tab and whack the thing through FXCop and/or StyleCop. Repeat until done. Then, and only then release the tool. To say that it doesn't count because it's generated code is anarchy. Any development group inside MS could then stuff anything they felt like in a generated file. Brad Abrahams in his 'Coding Style Guidelines' document said "The reasons to extend the public rules (no Hungarian, no prefix for member variables, etc.) is to produce a consistent source code appearance. In addition a goal is to have clean readable source. Code legibility should be a primary goal." That is as valid for MS 'generated' code as for any other code they produce. End of! No ifs, ands or buts. If they are going to have rules they should stick to them, for all in-house code. If they are incapable of doing that, that tells us a lot about what to expect from any of their products in the future. :mad: :rolleyes: :zzz:
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Henry Minute wrote:
I said FXCop and I meant FXCop.
I have tried for ages to make FxCop enforce rules for private and internal members and I have not been able to do so. Can you share how you enabled it? As far as the design guidelines go, they make most sense when enforced on public/protected members (even though I enforce it everywhere as it comes to me naturally) as it is what developers using your library will use. I personally will not sweat if it s not enforced for private members in tool generated code as long as rest of the code is FxCop compliant.
-
Gary R. Wheeler wrote:
One O.S. to rule them all, one search to find them, one desktop to bring them all, and in the darkness bind them.
Weven does sound like it ought to be a river/village in Middle Earth. Doesn't it?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Sort of the low-rent district in Hobbiton, maybe.
Software Zen:
delete this;
Fold With Us![^] -
Henry Minute wrote:
With Windows 7, it's one rule for Redmond, another one for everyone else."
One O.S. to rule them all, one search to find them, one desktop to bring them all, and in the darkness bind them.
Software Zen:
delete this;
Fold With Us![^]