What is the naming convention for functions in c#? 11 1971
The naming guidelines can be found here... http://msdn.microsoft.com/library/de...guidelines.asp
--
Tim Wilson
..Net Compact Framework MVP
<to********@hotmail.com> wrote in message
news:11********************@g44g2000cwa.googlegrou ps.com... What is the naming convention for functions in c#?
Thanks for your responses!
What I'm actually looking for is some support for writing get/set
functions camel case?
e.g. getCustomer() but I won't find that, will I? Anywhere?
Best Regards,
Niclas Colleen
Kannan.V [MCSD.net] skrev: you could just google for the naming conventions for functions or Ms has a veyr good doc for writing C# code.
check this link. http://msdn.microsoft.com/library/de...guidelines.asp
-- Kannan.V Home : http://www.kannanv.com Blog : http://kannanv.blogspot.com Web : http://www.DotnetLounge.net
"Any one who has never made a mistake has never tried anything new" - Einstein
"to********@hotmail.com" wrote:
What is the naming convention for functions in c#?
<to********@hotmail.com> wrote: Thanks for your responses!
What I'm actually looking for is some support for writing get/set functions camel case? e.g. getCustomer() but I won't find that, will I? Anywhere?
No. Methods are always Pascal-cased by .NET conventions.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Thank you that's the decisive response I wanted.
Still it's not totally clear for me.
e.g. If I create a button and I call it btnSave, then the method this
button will trigger would be: btnSave_Click(...)
Is that correct? Or am I using an incorrect convention naming the
button?
Best regards,
Niclas Colleen
Jon skrev: <to********@hotmail.com> wrote: Thanks for your responses!
What I'm actually looking for is some support for writing get/set functions camel case? e.g. getCustomer() but I won't find that, will I? Anywhere?
No. Methods are always Pascal-cased by .NET conventions.
-- Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
<to********@hotmail.com> wrote: Thank you that's the decisive response I wanted.
Still it's not totally clear for me.
e.g. If I create a button and I call it btnSave, then the method this button will trigger would be: btnSave_Click(...)
Is that correct? Or am I using an incorrect convention naming the button?
Personally I find that a horrible name for a method, even though it's
what VS.NET will give you by default.
I'd suggest calling it something like: HandleSaveButtonClicked
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
I'm trying to get the naming guidelines straight here, and I guess this
means that VS.NET by default doesn't follow the naming guidelines?
responding to Kannan:
"What I'm actually looking for is some support for writing get/set
functions camel case?
e.g. getCustomer() but I won't find that, will I? Anywhere? "
Would you prefer to use property procedures for get/set methods? Again,
those would be Pascal case in C#.
Jason Gorman http://www.parlezuml.com
UML tutorials for Java & .NET
Thank's for the suggestion, but no, I prefer using methods.
The thing is, I'm quite sure we used camel case for get/set methods on
a VC++ project I worked in a couple of years ago. I just came to
wanting to find out if that was some official naming convention or just
specific for that project.
Having just started up a VS.NET project now I'm keen on following the
general standards.
I'm starting to feel pretty content on the naming guidelines now a part
from my previous question, though.
Best regards,
Niclas Colleen
<to********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com... Thank's for the suggestion, but no, I prefer using methods.
The thing is, I'm quite sure we used camel case for get/set methods on a VC++ project I worked in a couple of years ago. I just came to wanting to find out if that was some official naming convention or just specific for that project.
OK, I have to ask.
What do you have against properties?
The only time I use get/set methods explicitely is if my setter/getter
triggered "unusual behavior".
If my setter/getter does nothing more than validate/translate/store the
data, I think properties are the way to go.
Bill
<to********@hotmail.com> wrote: I'm trying to get the naming guidelines straight here, and I guess this means that VS.NET by default doesn't follow the naming guidelines?
Yup.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Hi Bill, I was referring to a specific scenario and not generally,
though, no one could no that:) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Generic Usenet Account |
last post by:
A lot has been said in this newsgroup regarding the "evil" set/get
accessor methods. Arthur Riel, (of Vanguard Training), in his class,
"Heuristis for O-O Analysis & Design", says that there is...
|
by: Derek |
last post by:
The company where I work uses a naming convention that I have
never used before. They use mixed-case letters for public
member functions, but lower-case with underscores for the
rest, like this:...
|
by: Ook |
last post by:
Is there any kind of naming convention for accessor and modifiers? What I've
been doing is something like this:
// accessor
int getSize();
// Modifier
void setSize( int newsize);
private:
|
by: Carl Colijn |
last post by:
Hi all,
Disclaimer: before I might trigger your "let's start a holy war!" button,
I'd like to say I'm not intended to; I just post this message to get some
input and not to promote "Yet Another...
|
by: Bruno Lavoie |
last post by:
Hello,
i'm etablishing a naming convention for a new project under
postgresql. For tables, sequences, views, that's ok! I used good
naming conventions for this in the past and i'll keep these...
|
by: dm1608 |
last post by:
I'm relatively new to ASP.NET 2.0 and am struggling with trying to find the
best naming convention for the BAL and DAL objects within my database. Does
anyone have any recommendations or best...
|
by: Jonathan Wood |
last post by:
I was just wondering what naming convention most of you use for class
variables.
Underscore, "m_" prefix, camel case, capitalized, etc?
Has one style emerged as the most popular?
Thanks for...
|
by: Bill Pursell |
last post by:
In libabc, I have a function which takes a NULL-terminated array
of character strings. A second, closely related function take
a NULL-terminated array of void *:
abc_foo( char ** );
abc_vfoo(...
|
by: Thorsten Kampe |
last post by:
Okay,
I hear you saying 'not another naming conventions thread'. I've read
through Google and the 'naming conventions' threads were rather
*spelling conventions* threads.
I'm not interested...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |