[MonkeyScript] [TitleIndex] [WordIndex

Naming scheme should attempt to be similar to the same naming guidelines as used in core JavaScript itself.

Class names should be in TitleCase.

   1 new Object;
   2 new File;
   3 new FilePath;

Variables, methods, and properties should be in camelCase.

   1 var monkeyWrench;
   2 array.slice();
   3 file.content;
   4 path.isFile;

If an action is known by a common name, try to use it over a unexpected name or casing.

   1 string.urlencode(); // Commonly referred to as urlencode, not as URL encode or urlEncode();
   2 

Avoid use of a function where a getter will suffice, but not when a related action needs to be a method.

   1 file.exist;
   2 string.substr(offset, length);
   3 string.urlencode(encodeFormat);
   4 string.urldecode(); // Does not need to be a method, but urlencode accepts arguments
   5 

I'm going to be doing some thinking before I descide any sort of namespace naming or how to ensure name uniqueness. However I do think I will normalize libarary names using .replace(/[-_]/, ).toLowerCase(); Characters like :.$[] will also be illegal.


2010-07-23 04:25