473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

C# code convention

Hi there,

I was wondering if someone could provide me with a C# code convention
document. I've tried to find some using "Google", but to no avail. I
did find plenty of Java Code conventions, which is pretty useful for C#
too, but I would really like a "dedicated" C# convention.

Thanks in advance,

Alke Wiebenga

Aug 21 '06 #1
9 6467
"Bala" <a_********@hotmail.comha scritto nel messaggio
news:11*********************@74g2000cwt.googlegrou ps.com...
I was wondering if someone could provide me with a C# code convention
document. I've tried to find some using "Google", but to no avail. I
did find plenty of Java Code conventions, which is pretty useful for C#
too, but I would really like a "dedicated" C# convention.
What do you mean with "code convention"?

Something like this:
http://msdn.microsoft.com/library/de...Guidelines.asp

?

--

Free .Net Reporting Tool - http://www.neodatatype.net
Aug 21 '06 #2
Check out the Microsoft Patterns and Practices web:
http://msdn.microsoft.com/practices/

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Orange you bland I stopped splaying bananas?
"Bala" <a_********@hotmail.comwrote in message
news:11*********************@74g2000cwt.googlegrou ps.com...
Hi there,

I was wondering if someone could provide me with a C# code convention
document. I've tried to find some using "Google", but to no avail. I
did find plenty of Java Code conventions, which is pretty useful for C#
too, but I would really like a "dedicated" C# convention.

Thanks in advance,

Alke Wiebenga

Aug 21 '06 #3
Bala,
I was wondering if someone could provide me with a C# code convention
document. I've tried to find some using "Google", but to no avail. I
did find plenty of Java Code conventions, which is pretty useful for C#
too, but I would really like a "dedicated" C# convention.
I think I understand what you are talking about I can recommend a good book:

Practical Guidelines and Best Practices for Microsoft Visual Basic and
Visual C# Developers

It is slightly out of date but it does the job and I refer to it often.
It is published by Microsoft.

Regards,

Richard
Aug 21 '06 #4
This is a good document for coding standards

http://www.icsharpcode.net/TechNotes...ingStyle03.pdf
Richard Whitcher wrote:
Bala,
I was wondering if someone could provide me with a C# code convention
document. I've tried to find some using "Google", but to no avail. I
did find plenty of Java Code conventions, which is pretty useful for C#
too, but I would really like a "dedicated" C# convention.

I think I understand what you are talking about I can recommend a good book:

Practical Guidelines and Best Practices for Microsoft Visual Basic and
Visual C# Developers

It is slightly out of date but it does the job and I refer to it often.
It is published by Microsoft.

Regards,

Richard
Aug 21 '06 #5
>I was wondering if someone could provide me with a C# code convention
>document. I've tried to find some using "Google", but to no avail. I
did find plenty of Java Code conventions, which is pretty useful for C#
too, but I would really like a "dedicated" C# convention.
Here's another one:

http://www.idesign.net/idesign/downl...20Standard.zip

Not one I can really recommend though, since last time I looked it
there were too many things I didn't agree with. But I guess just
having a standard, good or bad, is better than not having one at all.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Aug 21 '06 #6
"Mattias Sjögren" <ma********************@mvps.orgwrote in message
news:Ob**************@TK2MSFTNGP05.phx.gbl...
>
Not one I can really recommend though, since last time I looked it
there were too many things I didn't agree with. But I guess just
having a standard, good or bad, is better than not having one at all.
No, having a bad standard is bad - period. What's better than not having one
at all is having one that's not perfect (or that everyone agrees with).

///ark
Aug 21 '06 #7
Hi,

Thanks for the prompt responses!!!
I've got everything I need!

Thanks and bye now!

Alke Wiebenga

Aug 22 '06 #8
Take a look at this book:

The Elements of C# Style (Paperback)
by Kenneth Baldwin, Andrew Gray, Trevor Misfeldt

Hope this helps.
---
Posted via www.DotNetSlackers.com
Aug 22 '06 #9
On Mon, 21 Aug 2006 16:46:29 -0700, "Mark Wilden"
<mw*****@communitymtm.comwrote:
>"Mattias Sjögren" <ma********************@mvps.orgwrote in message
news:Ob**************@TK2MSFTNGP05.phx.gbl...
>>
Not one I can really recommend though, since last time I looked it
there were too many things I didn't agree with. But I guess just
having a standard, good or bad, is better than not having one at all.

No, having a bad standard is bad - period. What's better than not having one
at all is having one that's not perfect (or that everyone agrees with).
Firstly, let me say that I think coding standards are a Very Good
Thing Indeed. But who defines what is a bad standard? One that enough
people disagree with? Nobody will ever agree on "correct" coding
standards, in the end it is a matter of personal preference. Mostly
though, I tend to agree with the majority of the standards that I have
read. Even where they conflict, heh.

As far as code *layout* is concerned (as apart from standards, and
this really is a matter of personal preference), one reason I am
migrating from C++ to C# is because I prefer to write:

if (condition)
{
stuff;
}

rather than the (IMO) ghastly:

if (condition) {
stuff;
}

Oh, and I hate:

if { (condition ) }
{
stuff;
}

too.

Well, we all have our little foibles...
Aug 22 '06 #10

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

Similar topics

0
by: Geoffrey | last post by:
Hi all, I am doing some research on java (J2SE and J2EE) ANT-enabled audit tools and code convetions. So far I have comprised the following lists: Audit tools usable from ANT with XML output:...
1
by: Asapi | last post by:
1. Are linkage convention and calling convention referring to the same thing? 2. Does calling convention differ between languages C and C++? 3. How does calling convention differ between...
22
by: San | last post by:
Hi, I wrote two simple constructors (one of them default) to initialize a student object. Student::Student(string name) { student_name = name; student_id = LATEST_ID + 1;...
19
by: Alan Silver | last post by:
Hello, I have been developing ASP.NET with a text editor so far (better way to learn initially), and have now been trying Visual Web Developer. I want to create a project for an existing site...
4
by: **Developer** | last post by:
I looked at MSDN and a book and both described the naming convention for parameters should be camel style. The book used camel, except for Set (ByVal Value as ...) There it always used an...
32
by: Jon Paal | last post by:
trying to use this script for scrolling tables found at this link: http://www.litotes.demon.co.uk/example_scripts/tableScroll.html The top left corner in the table grid is hidden from being...
29
by: Gernot Frisch | last post by:
Hi, I have no clue. - I want to align the red, green, blue boxes in one line - red,green,blue must be 45px high - red (center) must be as wide as possible - yellow must start exactly below...
2
by: cada0310 | last post by:
Hi there, I'm new to C# (but not to C++), and I'm trying to create a web service that calls some of our older software, located in a DLL. I'm getting most the calls to work ok, but one of them...
6
by: Ole Nielsby | last post by:
VC has a __cdecl specifier which allows functions and methods to be called with varying parameter count. (I understand this is the default for functions in general but in VC, instances use...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.