Code Presentation ConventionsIn addition to the standard document conventions covered in , there are some additional conventions
related specifically to discussing source code:
classnameThis is the name of a class in an object-oriented
(OO) programming language. For example, the
class
com.arsdigita.categorization.CategoryTreeNode.
method nameThis is the name of a method in an OO programming language,
e.g. the method getBaseDataObjectType.
functionThe name of a function or subroutine, as in a programming
language. For example, the function
SecurityLogger.warn().
variable nameThe name of a variable. For example, the variable
BASE_DATA_OBJECT_TYPE.
An option for a software command or
Method. For example, a user has been granted
privileges on an object.
return valueThe value returned by a function. For example, a method returns
null.
replaceableContent that may, must or will be replaced by the user or a
program. For example, the code is commented with
NOTE(n),
where n is the number of the
NOTE.
program listingA literal listing of all or part of a program. The
\ character is used to break a line
for printing purposes. You will want to reconnect them back into a
single line, preserving the spacing in the line.
import com.arsdigita.kernel.permissions.PermissionService;
import com.arsdigita.kernel.permissions.PermissionDescriptor;
import com.arsdigita.kernel.permissions.PrivilegeDescriptor;
import com.arsdigita.persistence.OID;
OID acsObject = new OID("example.MyACSObject",
new BigDecimal(50));
OID party = new OID("com.arsdigita.kernel.Group", new BigDecimal(5));
PermissionDescriptor perm =
new PermissionDescriptor(PrivilegeDescriptor.READ,
acsObject, party);
PermissionService.grantPermission(perm);
first termThe first occurrence of a term, such as the first time we
introduce a bulletin-board and note its
abbreviated form, bboard.