Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-17-2004, 10:19 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
Class / Method Naming Conventions

I am referring to primarily camel case vs pascal case for class names and methods.

I suppose for specifically I am referring to conventions that would be used by Java and c#.

From what I gather, classes which are primarily static in nature begin with a capital.

Classes that are not static, are pascal case.

Same goes for methods? I'm not sure. What is the most common practice for naming classes and methods?
__________________
Mike
sde is offline   Reply With Quote
Old 06-17-2004, 11:16 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,140
Belisarius is on a distinguished road
C# is all messed up, and I can't speak for it. But in Java, here's how it works.

Classes begin with a capital letter and use a capital letter for every word in the class name. Methods and variables have a lowercase beginning letter and an uppercase letter for the first letter of every subsequent word. Static final fields that are meant to be a reference to some unchanging value (for instance, PI is the name of the variable that represents a double roughly equal to pi).

See http://java.sun.com/docs/codeconv/ht....doc8.html#367
__________________
GitS
Belisarius is offline   Reply With Quote
Old 06-17-2004, 11:33 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
oh cool! i'm glad i asked before i got too deep into this new project.

great link.

thanks!
__________________
Mike
sde is offline   Reply With Quote
Old 06-18-2004, 05:58 AM   #4 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,545
Valmont is on a distinguished road
Quote:
C# is all messed up, and I can't speak for it.
I'll come back to this later but now I gotta run.
__________________
Valmont is offline   Reply With Quote
Old 06-18-2004, 07:07 AM   #5 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,545
Valmont is on a distinguished road
For .NET
Type - Case - Notes
Class / Struct - Pascal Casing
Interface - Pascal Casing - Starts with I
Enum values - Pascal Casing
Enum type - Pascal Casing
Events - Pascal Casing
Exception class - Pascal Casing - End with Exception
public Fields - Pascal Casing
Methods - Pascal Casing
Namespace - Pascal Casing
Property - Pascal Casing
Protected/private - Fields Camel Casing
Parameters - Camel Casing
__________________
Valmont is offline   Reply With Quote
Old 06-21-2004, 08:16 PM   #6 (permalink)
npa
Code Monkey
 
Join Date: Jul 2003
Location: canada
Posts: 82
npa is on a distinguished road
Quote:
Originally posted by Valmont
I'll come back to this later but now I gotta run.
I couldn't agree more that c# naming system is totally annoying
coming from a java background, even more annoying is the
properties that let you pretend you are performing a simple
assignment but are calling some, possible totally obscure,
method.

Having worked with this in the real world it is an
absolute nightmare to have this happen when some junior
programmer goes a little mad and decides to make obscure
use of this behaviour
__________________
direct entry file specification.
npa is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
someone please help kickerman97 Java 3 10-19-2004 03:19 PM
Naming Conventions and Hungarian Notation RobertStout Standard C, C++ 2 10-17-2004 11:32 AM


All times are GMT -8. The time now is 11:47 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting