473,703 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1411
Hi,

"UJ" <fr**@nowhere.c om> wrote in message
news:e0******** ******@TK2MSFTN GP14.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.c om> wrote in message
news:e0******** ******@TK2MSFTN GP14.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.mi crosoft.com> wrote in
message news:78******** *************** ***********@mic rosoft.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.mi crosoft.com> wrote in
message news:78******** *************** ***********@mic rosoft.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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3614
by: David Inada | last post by:
Looking for any info on coding standards for ASP? Any tools that help with the review/formatting of code? Is it done mainly for the jscript/vbscript components? David
3
2053
by: ganesan | last post by:
Hi Guys, Could any one knows the best coding standards styles(with variable declarations for c#) . and if any links or site with the best coding standards for .NET send me those links regards Ganesan
4
2291
by: dotNetDave | last post by:
About three weeks ago I released the first .NET coding standards book titled "VSDN Tips & Tricks .NET Coding Standards". Here is what the famous author/ speaker Deborah Kurata says about it: "David McCarter once again demonstrates his knack for pulling best practices into one cohesive unit with his new book "VSDN Tips and Tricks: .NET Coding Standards". This book includes everything from how to set up your project to how to declare...
5
5403
by: db2sysc | last post by:
ALl. Is it possible to get MS ACCESS CODING STANDARDS? TIA
144
6867
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this initiative. Typically I find that coding standards are written by some guy in the company who has a way of coding that he likes and then tries to force everybody else to write code the way he likes it, not for any rational reason, but simply for the...
7
2561
by: Ralph Lund | last post by:
Hi. I am starting a new project with C#. I am searching for "good" coding conventions. I know that there are some coding conventions from microsoft, (but they are very extensive and not clear). In the example programs of Microsoft they use different coding conventions: private members sometimes with underscore, sometimes without; when calling a method sometimes: method(param1, param2) or method ( param1, param2) (with or without...
7
4949
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already developed significant content for the C programming language that is available at: https://www.securecoding.cert.org/ by clicking on the "CERT C Programming Language Secure Coding Standard"
3
1776
by: editormt | last post by:
A recent poll asked if programming standards are used by development organisations... and if they are controlled. None: 20% Yes, but without control: 49% Yes, with control: 31% Participants: 369 Source: Methods & Tools (http://www.methodsandtools.com)
0
1672
by: pat | last post by:
CodeCheck Coding Standard's Support As a free service to our customers we offer support in developing "rule-files" for automating corporate coding standards. If you have a coding standard that you wish to automate please send the standard to us in PDF format so we can assist in developing the automation with codecheck. If you are developing codecheck rule-files and have a particular
9
2095
by: dom.k.black | last post by:
Can anyone recommend a good existing C++ coding standard - parctical, pragmatic and sensible? A company I joined recently are moving from C to C++, they are very much into coding standards. But I have a horibble feeling they might get a C programmer to write the C++ standard. Would be nice to be able to suggest an existing standard.
0
8657
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7839
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6581
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3108
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2047
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.