0

Is it true, that there is a convention that purports, only to use camel code in object-oriented languages (as the W3C states in the link below)​​? If so why?

From the W3C:

It is common, in object oriented languages, to use camel-case names. You will often see names like someMethod(), instead of some_method().

https://i.stack.imgur.com/EhSIa.png
http://w3schools.com/js/js_obj_intro.asp (at the bottom of the page)

Senkaku
  • 197
  • 2
  • 10
  • I use(d) camel case with ActionScript 2, which was wasn't very close to being fully OOP compliant. For me it was easy to continue doing so because that is what I was taught and what I know to help make code readable rather than switching between camel case and some other format. – Anil Jan 20 '14 at 00:42

1 Answers1

1

No, camel-case predates object-oriented programming. Programming languages have almost always had a limited character set from which variables and other object names could be composed. Because white-space is virtually never allowed and characters like "_" or "-" may not be, programmers have tried several conventions which make multi-word identifiers easier to read. Camel-case is just one convention.

Ned
  • 937
  • 6
  • 10