Coding

Commenting

  • The more comments, the better. Some people who work on mods are very new at working with Lua and/or XML, but have great ideas on what should be changed
  • Remember that not everybody who might look at your code speaks English - try to avoid using things that aren't really words in your comments (abbreviations, slang, etc) to make it more likely that a web translation service can translate it for others
  • For XML, comments look like...
    <!-- Your comment here -->
    
  • For Lua, comments look like...
    -- Your comment here
    
  • For Lua, try to include one comment at the top of every file you write, and one comment at the top of every function you write (See  Input With Log Base as an example) ...
    ------------------------------------------------------------------------------- 
    -- Title: Name the stuff in the file
    -- Author: Put a name/nickname and (optionally) an e-mail for everybody who worked on this
    -- Version: Give version numbers for the file
    -- Date: Date the version
    -- Description: 
    --     Give some description
    --     Whatever details you think people might need
    ------------------------------------------------------------------------------- 
    
    TableForFile = {}
    
    ------------------------------------------------------------------------------- 
    -- TableForFile.SomeFunction 
    -- Description: 
    --     Some description 
    -- Parameters: 
    --     arg1 - describe whatever arg1 is
    --     arg2 - describe whatever arg2 is
    -- Returns: 
    --     Give details on what is returned 
    ------------------------------------------------------------------------------- 
    TableForFile.SomeFunction(arg1, arg2)
    

Checking in your Changes

  • Check in changes that go together as a whole (and without any extra files) when possible. This makes it easier to remove individual changes if something goes wrong
  • Add messages to every commit detailing what changes you are checking in

Using Work From Other Skins

  • Make sure you don't copy over any .svn folders when copying files over from another skin. These folders contain information indicating where commits go to and updates come from, so if you were to copy the "CustomSettings?" folder from BB_Enhanced, for example, and didn't remove the .svn folder before making changes, and changes you made in that folder would get checked into BB_Enhanced, not your skin.
  • If it's not your work, make sure you make a note of where you got it from (if there aren't already comments in the files that say so). Also, adding a readme to your skin that indicates who provided what changes is nice.