Coming from a Java background, I\'m very used to camelCase. When writing C, usin
ID: 639700 • Letter: C
Question
Coming from a Java background, I'm very used to camelCase. When writing C, using the underscore wasn't a big adjustment, since it was only used sparingly when writing simple Unix apps. In the meantime, I stuck with camelCase as my style, as did most of the class.
However, now that I'm teaching myself C# in preparation for my upcoming Usability Design class in the fall, the PascalCase convention of the language is really tripping me up and I'm having to rely on intellisense a great deal in order to make sure the correct API method is being used. To be honest, switching to the PascalCase layout hasn't quite sunk in the muscle memory just yet, and that is frustrating from my point of view.
Since C# and Java are considered to be brother languages, as both are descended from C++, why the variation in the language conventions? Was it a personal decision by the creators based on their comfort level, or was it just to play mindgames with new introductees to the language?
Explanation / Answer
The culture difference originated long before C# or Java.
All three conventions have coexisted since the late 60s or early 70s, and have been popular in different groups. (As well as other conventions, including the unlamented Hungarian notation that Microsoft inflicted on so many for so long.)
In particular the inventors of Java were at Sun, and many were involved with StrongTalk, which is a form of Smalltalk. The Smalltalk community has used camelCase for a very, very long time.
The inventors of C# came from Microsoft. StudlyCaps was one of the major conventions at Microsoft, and is heavily seen in places like Visual C++.
Those originator styles appear in all of the core documentation, which influences groups who pick up the language, and therefore has caused the split in capitalization conventions between two very similar languages.