Jiffle.net

Skip to content



Naming

Submitted by david on Tue, 13/09/2005 - 00:18.

General

All names (of variables, classes and methods) should be meaningful English words. The only exception to this is for loop variables or other simple iterators, but even then single letter variables (such as ‘i’, ‘j’, ‘k’) should not be used. Variables and classes should normally comprise of nouns, interfaces are commonly adverbs (e.g. Serializable) and should not be prefixed by I, and methods are often verbs.

Variables and Fields

Variable names should begin with a lower-case character. If the name is made up of multiple English words, each word (except the first) should begin with an Upper-case character. All other characters should be lower-case No other separator should be used.

Variables should not be shorter than 3 characters in length. Instance member fields should be prefixed with ‘i’, and class member variables with ‘s’. After that, no other ‘_’ separator should be used.

A special case is to be made for Struts ActionForms, which contain two types of instance fields. The convention in this case is to use ‘p’ for the fields that are used as properties (i.e. That have ‘get’ and ‘set’ methods) and ‘i’ for the instance fields (that have ‘insert’ and ‘extract’ methods).

Constants (i.e. those attributes of a class which are defined as static final) should be all upper-case, with words within the identity separated by underscore.

Classes

The name of a class should begin with a Capital letter. If it is made up of multiple English words, each should begin with a Capital letter. All other letters should be lower-case No other separator (such as ‘_’) should be used. Only the first letter of acronyms should be capitalized.

Abstract class names should contain one of the following three identifiers for that quality: ‘Abstract’, ‘Factory’ or ‘Base’.

Packages

Packages names should be single lower-case words.

moN1hU zhbgbmhslgly, [url=http://qacbnkioyqsz.com/]qacbnkioyqsz[/url], [link=http://jwhvkksifcpy.com/]jwhvkksifcpy[/link], http://elkcnkcrvlid.com/

Submitted by vsutaxut (not verified) on Wed, 27/08/2008 - 05:33.

31x4CT ozvwsvzhbmyd, [url=http://dnzqssieynhl.com/]dnzqssieynhl[/url], [link=http://dviduadawjqe.com/]dviduadawjqe[/link], http://nkqxeyhojbhi.com/

Submitted by tsvjkvbkdr (not verified) on Wed, 16/07/2008 - 00:42.
Submitted by Johny (not verified) on Thu, 26/06/2008 - 05:03.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


© David Hamilton 2007
Powered by Drupal Logo