- Tabs, not spaces. This formatting rule is a a matter of religion. GeoMOOSE worships in the House of “\t”. Code submissions will be returned if the indentation uses spaces.
- function brackets should be at the end of a function declaration.
Bad:
foo: function () { } function foo () { }Good:
foo: function () { } function foo() { }
Methods should be camelCased.
Private methods should begin with an underscore.
_myPrivateMethod: function () { }Variable names inside of methods and functions should use under case and be underscore delimited.
var my_variable_in_a_function = 0;Please format comments to be parsed with NaturalDocs. This is the same library used by OpenLayers. This allows for better class and API documentation building.
- Scour the documentation first, especially the GeoMOOSE API namespace, there is a lot of functionality there.
- Check OpenLayers, especially OpenLayers.Util.
- Subclass! Copying and pasting is ugly and creates long term support-ability issues. You are very likely copying and pasting the bugs into your code.