471,350 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

Coding Standards

UJ
Folks,
Can anybody point me towards a site that explains the Microsoft Coding
Standards? I downloaded FXCop and understandably it's complaining a lot.

I do have questions though:

1. What if any prefixes should be used to define scope of variables.
2. How are people naming properties? I currently use a prefix of prp so
they are all grouped together and easy to find. FXCop doesn't like that.

Any thoughts or suggestions would be appreciated.

TIA - Jeff.
Feb 15 '06 #1
11 1349
Hi,

"UJ" <fr**@nowhere.com> wrote in message
news:e0**************@TK2MSFTNGP14.phx.gbl...
Folks,
Can anybody point me towards a site that explains the Microsoft Coding
Standards? I downloaded FXCop and understandably it's complaining a lot.

I do have questions though:

1. What if any prefixes should be used to define scope of variables.
2. How are people naming properties? I currently use a prefix of prp so
they are all grouped together and easy to find. FXCop doesn't like that.


Don't FxCop gives you a link to where you can see a detailed explanation
of why it flagged it?

Anyway, see
http://msdn.microsoft.com/library/de...guidelines.asp
for further details
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Feb 15 '06 #2

"UJ" <fr**@nowhere.com> wrote in message
news:e0**************@TK2MSFTNGP14.phx.gbl...
Folks,
Can anybody point me towards a site that explains the Microsoft Coding
Standards? I downloaded FXCop and understandably it's complaining a lot.

I do have questions though:

1. What if any prefixes should be used to define scope of variables.
2. How are people naming properties? I currently use a prefix of prp so
they are all grouped together and easy to find. FXCop doesn't like that.


Thank goodness.

Do you really think that it is helpful to use a totally different convetion
to all the microsoft stuff and everything ever written in any book I have
ever read?

Just as an example: If I want the address of a person then I expect to find
it named "Address" - It will probably be a property but if it's a method
then that's cool too.

So I type 'A' and there it will be in intellisense near the top of the list.
How is this better than typing "prpA"?

Even if somehow it does help you when you are developing your code this is
irrelevant as the main aim with methods and properties is to name them in a
way that is helpful to users of the class.

Feb 15 '06 #4
UJ,

I'm finding the following very useful for this:
http://www.irritatedvowel.com/Progra...Standards.aspx

Regards,

Greg

Feb 15 '06 #5
Using convention strongly is usefull in the bounds of company, to give u
solid code understanding and improve readability.

Conventions in artives and magazines are simplified, because author want to
show you the gist of the code.
In your case, Address means a property, coz it's common for the properties
to start with capital letter.
We more read then type, and for this reason the usability of typing doesn't
make sence - there are several VSIDE addings, that improve intelliscence and
could show you either properties or methods first.
The idea to make code readable.

Hungarian notation lost its sence due to metadates in .net - we move mouse
over the method/property and we got description.
Do you really think that it is helpful to use a totally different convetion
to all the microsoft stuff and everything ever written in any book I have
ever read?

Just as an example: If I want the address of a person then I expect to find
it named "Address" - It will probably be a property but if it's a method
then that's cool too.

So I type 'A' and there it will be in intellisense near the top of the list.
How is this better than typing "prpA"?

Even if somehow it does help you when you are developing your code this is
irrelevant as the main aim with methods and properties is to name them in a
way that is helpful to users of the class.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Feb 15 '06 #6
Jeff,
Below is a site with a link to a standards document that I've adopted.
It hasn't been updated in a while, but it was pretty complete to begin
with.

http://weblogs.asp.net/lhunt/archive...dardsv113.aspx

The only hungarian notation that I still use is with windows form
control names (i.e., btnApply, etc) to help in finding them quickly.
Private field names prefixed with underscore comes in handy.

BTW, I think it's great that there are others out there at least trying
to adhere to a standard.

-SLC

Feb 15 '06 #7
UJ
Thanks for the info.

Can you suggest any of the VS IDE Add-ons that will improve intellisense?

TIA - Jeff

"Michael Nemtsev" <Mi************@discussions.microsoft.com> wrote in
message news:78**********************************@microsof t.com...
Using convention strongly is usefull in the bounds of company, to give u
solid code understanding and improve readability.

Conventions in artives and magazines are simplified, because author want
to
show you the gist of the code.
In your case, Address means a property, coz it's common for the properties
to start with capital letter.
We more read then type, and for this reason the usability of typing
doesn't
make sence - there are several VSIDE addings, that improve intelliscence
and
could show you either properties or methods first.
The idea to make code readable.

Hungarian notation lost its sence due to metadates in .net - we move
mouse
over the method/property and we got description.
Do you really think that it is helpful to use a totally different
convetion
to all the microsoft stuff and everything ever written in any book I have
ever read?

Just as an example: If I want the address of a person then I expect to
find
it named "Address" - It will probably be a property but if it's a method
then that's cool too.

So I type 'A' and there it will be in intellisense near the top of the
list.
How is this better than typing "prpA"?

Even if somehow it does help you when you are developing your code this
is
irrelevant as the main aim with methods and properties is to name them in
a
way that is helpful to users of the class.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not
cease to be insipid." (c) Friedrich Nietzsche

Feb 15 '06 #8
Try FxCop. It's not for improving intellisense, but Microsofts own tool
for checking code. It will flag anything that break their naming
conventions. They also give well explained reasons for their naming
convention rules.

And, even though it is Microsoft, it is free ...

Halvard.
UJ skrev:
Thanks for the info.

Can you suggest any of the VS IDE Add-ons that will improve intellisense?

TIA - Jeff

"Michael Nemtsev" <Mi************@discussions.microsoft.com> wrote in
message news:78**********************************@microsof t.com...
Using convention strongly is usefull in the bounds of company, to give u
solid code understanding and improve readability.

Conventions in artives and magazines are simplified, because author want
to
show you the gist of the code.
In your case, Address means a property, coz it's common for the properties
to start with capital letter.
We more read then type, and for this reason the usability of typing
doesn't
make sence - there are several VSIDE addings, that improve intelliscence
and
could show you either properties or methods first.
The idea to make code readable.

Hungarian notation lost its sence due to metadates in .net - we move
mouse
over the method/property and we got description.
Do you really think that it is helpful to use a totally different
convetion
to all the microsoft stuff and everything ever written in any book I have
ever read?

Just as an example: If I want the address of a person then I expect to
find
it named "Address" - It will probably be a property but if it's a method
then that's cool too.

So I type 'A' and there it will be in intellisense near the top of the
list.
How is this better than typing "prpA"?

Even if somehow it does help you when you are developing your code this
is
irrelevant as the main aim with methods and properties is to name them in
a
way that is helpful to users of the class.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not
cease to be insipid." (c) Friedrich Nietzsche


Feb 15 '06 #9
Obviously I didn't read all the posts in this thread before I answered,
otherwise I wouldn't have suggested FxCop.
Shame on me :)

Just ignore ...

Halvard.

Feb 15 '06 #10
Jetbrains resharper will definitely improve VS.NET's intellisense a lot

"UJ" <fr**@nowhere.com> wrote in message
news:uF**************@TK2MSFTNGP14.phx.gbl...
Thanks for the info.

Can you suggest any of the VS IDE Add-ons that will improve intellisense?

TIA - Jeff

"Michael Nemtsev" <Mi************@discussions.microsoft.com> wrote in
message news:78**********************************@microsof t.com...
Using convention strongly is usefull in the bounds of company, to give u
solid code understanding and improve readability.

Conventions in artives and magazines are simplified, because author want
to
show you the gist of the code.
In your case, Address means a property, coz it's common for the
properties
to start with capital letter.
We more read then type, and for this reason the usability of typing
doesn't
make sence - there are several VSIDE addings, that improve intelliscence
and
could show you either properties or methods first.
The idea to make code readable.

Hungarian notation lost its sence due to metadates in .net - we move
mouse
over the method/property and we got description.
Do you really think that it is helpful to use a totally different
convetion
to all the microsoft stuff and everything ever written in any book I
have
ever read?

Just as an example: If I want the address of a person then I expect to
find
it named "Address" - It will probably be a property but if it's a method
then that's cool too.

So I type 'A' and there it will be in intellisense near the top of the
list.
How is this better than typing "prpA"?

Even if somehow it does help you when you are developing your code this
is
irrelevant as the main aim with methods and properties is to name them
in a
way that is helpful to users of the class.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not
cease to be insipid." (c) Friedrich Nietzsche


Feb 15 '06 #11
See list of tools there http://www.refactoring.com/tools.html

ReSharper not good choose with big solutions, it's go down with even 10
projects in solution.
Im using Refactor Pro!

Moreover, look at code-analyzing tools, such as FixCop or .NET Test from
ParaSoft. They perform static analyzis of your code to check how it conforms
your corporate code standards. You can tune these tools for your own
codestandards

"UJ" wrote:
Thanks for the info.
Can you suggest any of the VS IDE Add-ons that will improve intellisense?
TIA - Jeff

Using convention strongly is usefull in the bounds of company, to give u
solid code understanding and improve readability.
Conventions in artives and magazines are simplified, because author want
to
show you the gist of the code.
In your case, Address means a property, coz it's common for the properties
to start with capital letter.
We more read then type, and for this reason the usability of typing
doesn't
make sence - there are several VSIDE addings, that improve intelliscence
and
could show you either properties or methods first.
The idea to make code readable.

Hungarian notation lost its sence due to metadates in .net - we move
mouse
over the method/property and we got description.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Feb 15 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by David Inada | last post: by
3 posts views Thread by ganesan | last post: by
4 posts views Thread by dotNetDave | last post: by
5 posts views Thread by db2sysc | last post: by
144 posts views Thread by Natt Serrasalmus | last post: by
7 posts views Thread by Ralph Lund | last post: by
7 posts views Thread by Robert Seacord | last post: by
3 posts views Thread by editormt | last post: by
9 posts views Thread by dom.k.black | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.