473,405 Members | 2,310 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,405 software developers and data experts.

Camel case

Can anyone provide an intrinsic justification (i.e. not related to
popularity or standardization) for using camel case notation? Just saying
to distinguish certain variable types is not sufficient in my mind because
there ARE other notations besides camel and Pascal, after all!

Bob Rosen
Jul 21 '05 #1
4 9647
You'll find Camel Casing a standard convention in languages like C, Java,
C#, etc.

These languages are case-sensitive. I can't say for sure, but I'll bet that
because of the case-sensitivity and the fact that it's easier to type in
lower case than upper (Pascal Casing), camel was devised.

For example, a class named "person" would be typed in all lower case, thus
never needing to type a cap. However, when you want to create a name that
combines 2 words, it becomes difficult to read the name because the words
run together, so voilla! The second and subsequent words are capitalized.

Just guessing here.

"Bob Rosen" <bo******@zipcon.net> wrote in message
news:10***************@news.zipcon.net...
Can anyone provide an intrinsic justification (i.e. not related to
popularity or standardization) for using camel case notation? Just saying
to distinguish certain variable types is not sufficient in my mind because
there ARE other notations besides camel and Pascal, after all!

Bob Rosen

Jul 21 '05 #2
Can you provide intrinsic justification for any notation?
(As a little note, the hungarian notation argument that it tells you the
variable type works both as an argument to use it (sometimes it does tell
you the type) and to not use it(sometimes its wrong), so that really won't
work.

"Bob Rosen" <bo******@zipcon.net> wrote in message
news:10***************@news.zipcon.net...
Can anyone provide an intrinsic justification (i.e. not related to
popularity or standardization) for using camel case notation? Just saying
to distinguish certain variable types is not sufficient in my mind because
there ARE other notations besides camel and Pascal, after all!

Bob Rosen

Jul 21 '05 #3
Bob,
Just saying
to distinguish certain variable types is not sufficient in my mind because camelCasing is independant of distinguishing variable types!

You can use both Camel & Pascal casing without identifying any type
information. I normally include only type or only purpose in the identifier
name, rarely both.

Camel & Pascal Casing are used to signify word breaks in an identifier,
alternatives include underscores or other special characters (in COBOL we
used Hyphens). I tend to find camelCasing & PascalCasing easier to read then
underscores or all caps & hyphens.

Or as the below web site states about Camel & Pascal case that "the first
letter of each subsequent concatenated word are capitalized"

http://msdn.microsoft.com/library/de...tionstyles.asp

For private variables I will use m_ to identify private member variables,
otherwise I avoid underscores in identifiers.

samples:
camelCasing
PascalCasing
COBOL-CASING
underscore_casing

I find the first two more readable then the last two, granted COBOL-CASING
is not valid C# or VB.NET identifier.

Hope this helps
Jay
"Bob Rosen" <bo******@zipcon.net> wrote in message
news:10***************@news.zipcon.net... Can anyone provide an intrinsic justification (i.e. not related to
popularity or standardization) for using camel case notation? Just saying
to distinguish certain variable types is not sufficient in my mind because
there ARE other notations besides camel and Pascal, after all!

Bob Rosen

Jul 21 '05 #4
I've thought of:

lisp-casing
TRADITIONAL_BASIC_CASING
_alternativeMemberCasing
anotherMemberCasing_
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Bob,
Just saying
to distinguish certain variable types is not sufficient in my mind because
camelCasing is independant of distinguishing variable types!

You can use both Camel & Pascal casing without identifying any type
information. I normally include only type or only purpose in the identifier name, rarely both.

Camel & Pascal Casing are used to signify word breaks in an identifier,
alternatives include underscores or other special characters (in COBOL we
used Hyphens). I tend to find camelCasing & PascalCasing easier to read then underscores or all caps & hyphens.

Or as the below web site states about Camel & Pascal case that "the first
letter of each subsequent concatenated word are capitalized"

http://msdn.microsoft.com/library/de...tionstyles.asp
For private variables I will use m_ to identify private member variables,
otherwise I avoid underscores in identifiers.

samples:
camelCasing
PascalCasing
COBOL-CASING
underscore_casing

I find the first two more readable then the last two, granted COBOL-CASING
is not valid C# or VB.NET identifier.

Hope this helps
Jay
"Bob Rosen" <bo******@zipcon.net> wrote in message
news:10***************@news.zipcon.net...
Can anyone provide an intrinsic justification (i.e. not related to
popularity or standardization) for using camel case notation? Just

saying to distinguish certain variable types is not sufficient in my mind because there ARE other notations besides camel and Pascal, after all!

Bob Rosen


Jul 21 '05 #5

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

Similar topics

32
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some...
17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
19
by: Robert Scheer | last post by:
Hi. In VBScript I can use a Select Case statement like that: Select Case X Case 1 to 10 'X is between 1 and 10 Case 11,14,16 'X is 11 or 14 or 16 End Select
1
by: ST | last post by:
Hi, I'm trying to debug someone else's code, and I'm going thru this Select Case statement. I'm having problems with the "OTHER" case...in that when the first line of the case is false, it jumps...
2
by: cs168 | last post by:
Hi I am new in ASP programming so I do use the very basic and simple way to do all my stuff. Now I do really got stuck at how can I loop thru the calculation for all my selection.. My full code is as...
4
by: Bob Rosen | last post by:
Can anyone provide an intrinsic justification (i.e. not related to popularity or standardization) for using camel case notation? Just saying to distinguish certain variable types is not sufficient...
2
by: Jon Miller | last post by:
Hi, I created a web service using Java/JAX-WS. I'm able to consume this web service using VS 2005 and .NET without a problem. However, the class and property names that were generated for the...
22
by: John | last post by:
Hi Folks, I'm experimenting a little with creating a custom CEdit control so that I can decide on what the user is allowed to type into the control. I started off only allowing floating point...
24
by: clockworx05 | last post by:
Hey guys i have this program that i need to write for class. here are the instructions: Write a function called foo that asks the user for their age. Pass the age value to a function called...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
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,...
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
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
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,...
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.