Terminology for objects
The terminology used to describe the methods and properties of objects is not consistent in the programming community. The following list shows three common naming schemes.
•
Object members
Object methods
Object properties
•
Object properties
Object methods
Object attributes
•
Object properties
Object methods
Object properties
In the first scheme uses "members" as the term to encompass "methods" and "properties". The second scheme uses "properties" as the term to encompass "methods" and "attributes". The third scheme uses "properties" as the term to encompass "methods" and "properties". The order in which the schemes are presented is in order from least ambiguous to most ambiguous. Unfortunately this order does not conform to age of use of the schemes nor to the popularity of the schemes. As a result of the lack of consensus in the programming community, all of these naming schemes are represented in ScriptEase documentation, though the first one is preferred because it is not ambiguous. The following paragraphs explain these schemes in more detail.
The first scheme uses the term "member" for the both functions and data. A "method" is a function attached to an object and a "property" is a datum attached to an object. This scheme has the advantages of being clear and of using common terminology. The disadvantage is that the use of "members" to refer to "methods" and "properties" is not the most common. This scheme is preferred in ScriptEase documentation for a couple of reasons. First, objects are thought of as collections of routines and data, which is an intuitive and useful metaphor for describing objects. The term "member" fits nicely with the metaphor and is distinct from the terms for items in the collection. Second, the use of the terms "method" and "property" for the routines and data attached to or collected in an object is the most common usage.
The second scheme uses the term "property" for the both functions and data. A "method" is a function attached to an object and an "attribute" is a datum attached to an object. This scheme has the advantages of being clear and of using common terminology. The disadvantage is that the use of "attributes" for the data of objects is not the most common.
The third scheme uses the term "property" for the both functions and data. A "method" is a function attached to an object and a "property" is a datum attached to an object. This scheme is inherently confusing because it uses the same term "property" for two different concepts about an object.
Predefining objects with constructor functions