GeoMOOSE Logo
The Home of GeoMOOSE!
Home | Wiki | Live Demo | Getting Started | Documentation | Developers | Bug Tracker | Download

Previous topic

GeoMOOSE Sprite Generator, Toolbar and Catalog Styles

Next topic

Contributing to GeoMOOSE

This Page

GeoMOOSE Coding StandardsΒΆ

  1. Code Formatting.
  1. 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.
  2. function brackets should be at the end of a function declaration.

Bad:

foo: function ()
{
}

function foo ()
{
}

Good:

foo: function () {
}

function foo() {
}
  1. Methods should be camelCased.

  2. Private methods should begin with an underscore.

    _myPrivateMethod: function () {
    }
  3. Variable names inside of methods and functions should use under case and be underscore delimited.

    var my_variable_in_a_function = 0;
  4. 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.

  1. Do not create new dependencies in the core. Adding a library dependency is not something the GeoMOOSE team takes lightly. By comparison to other Web GIS distributions we strive to keep GeoMOOSE very light. We work quite hard to keep it appropriate for distribution to the public and to devices with limited bandwidth.
  2. DRY - Don’t Repeat Yourself.
  1. Scour the documentation first, especially the GeoMOOSE API namespace, there is a lot of functionality there.
  2. Check OpenLayers, especially OpenLayers.Util.
  3. 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.
  1. Keep UI and Library code separate. It may be tempting, with Javascript, but please keep oil out of the water - fragile sea-life depends on you. In a more serious note, if a function is meant to put content somewhere, write a function that generates the content in a machine parse-able format and separate code that renders it.
  2. All diff/patch files should indicate a version. Patches can be sent to the GeoMOOSE mailing list. The email should include a major GeoMOOSE version or an SVN revision number.
  3. All code submitted to GeoMOOSE should be free and clear of all license restrictions. If any one can claim ownership, a license, patent, or copyright we will reject the code. If you are not on the committers list then please include a message releasing the code into the public domain. Please reference the GeoMOOSE license for the terms under which GeoMOOSE is distributed.