Domanda

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().

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top