Linked by Thom Holwerda on Wed 2nd Dec 2009 23:17 UTC
Features, Office A few weeks ago, we talked about how the rise of computing, a field wherein English is the primary language, is affecting smaller languages, and more specifically, the Dutch language (because that's my native tongue). Of course, it's not just the smaller languages that are affected - English, too, experiences the pressure.
E-mail Print r 6   · Read More · 59 Comment(s)
Thread beginning with comment 397593
To read all comments associated with this story, please click here.
camel case in programming
by kristoph on Thu 3rd Dec 2009 00:50 UTC
kristoph
Member since:
2006-01-01

The reason why CamelCase was popularized in programing was not because of the size required by an identifier.

In the grand scheme of things an extra character in a multi-word identifier is not that impactful.

The primary motivation behind CamelCase was that, in many cases, early compilers and interpreters only permitted alpha-numerics in identifiers which gave rise to CamelCase for readability reasons.

Microsoft, of course, had a great deal to do with popularizing CamelCase as the entire API is CamelCase.

Reply Score: 1

RE: camel case in programming
by ebasconp on Thu 3rd Dec 2009 01:39 in reply to "camel case in programming "
ebasconp Member since:
2006-05-09

Agreed,

The rational on this is because compilers use identifier names [variables, classes, functions, methods, etc.] as an entity that just contains alphanumerical characters and a reduced number of symbols.

Space is generally treated as a separator, so, if a variable is called "my salary" instead of "mySalary" would create ambiguity for the compiler: "what is the variable name? 'my'? if the variable name is 'my'... what the hell is 'salary' here? I do not know a reserved word called 'salary' and after the variable 'my' I expect an operator or a function name to invoke"... or something like that ;)

Reply Parent Score: 2

Doc Pain Member since:
2006-10-08

Space is generally treated as a separator, so, if a variable is called "my salary" instead of "mySalary" would create ambiguity for the compiler: "what is the variable name? 'my'? if the variable name is 'my'... what the hell is 'salary' here? I do not know a reserved word called 'salary' and after the variable 'my' I expect an operator or a function name to invoke"... or something like that ;)


Quite easy: "my" is the (data)type of "salary". :-)

Reply Parent Score: 2

RE: camel case in programming
by bnolsen on Thu 3rd Dec 2009 14:58 in reply to "camel case in programming "
bnolsen Member since:
2006-01-06

The biggest kudos I give to Qt is their non strict camel casedness of their class methods.

My knee jerk reaction is to look at someone's code with CamelCased methods and immediately identify "oh, they must be another windows programmer".

Reply Parent Score: 2

TemporalBeing Member since:
2007-08-22

Microsoft, of course, had a great deal to do with popularizing CamelCase as the entire API is CamelCase.


I'm not sure Microsoft used Camel Case all that much until .NET - their legacy APIs (DOS, Win32, etc.) are full of Hungarian Notation, which they had a great deal in promoting. Basic/VBasic may be a different issue though.

Qt, on the other hand, has been using CamelCase for longer than .NET has been around; as have many others.

Reply Parent Score: 2