Skip to content

General Programming Protocol

Christopher Churchill edited this page Jun 2, 2017 · 8 revisions

Merging Code to Github:

  • Make sure your code is commented.
  • Test your code with a mentor or programming lead
  • Pull code from Github, in case there was an update.
  • Push your code to your Github branch
  • You can submit a pull request once you’ve completed your branch and will not make changes.
  • A mentor or programming lead with then check your code for problems, like lack of comments, a bit of code that does nothing or give advice on a more efficient way to code a segment.
  • Once the mentor or lead sees no problem they will then merge your code and deal with any merge conflicts that may occur.

Commenting:

  • What the code in the file does. Should coincide with the name of the file. (Group/Class comments, basically a descriptive block)
  • Every segment of code should have a comment stating what it should be doing. (Use descriptive blocks here)
  • Explain what confusing sections of the code is doing. (Use in-line comments for this)
  • Keep your comments readable, they are meant for humans to read not machines.
  • Keep a white space between the code and comments, as it’s easier to separate them.
  • Comment while you write the code, so you don’t need to try and remember what everything is for.
  • If there are bugs in the code but you need to leave, put a comment there at what you are currently trying to do and what the bug is.
  • Not every line should have comments.

Testing Code:

In Hallway

  • Tell a mentor programming lead that you are testing so they can help and verify that your code works. (for merging to Github).
  • Move robot into hallway.
  • Turn on robot.
  • Connect to robot using a router. (Wireless or wired, your choice)
  • Test your code after the robot is clear of people.
  • Turn off robot.
  • Disconnect from robot.
  • Return the robot into the classroom.

In Classroom

  • Tell a mentor or programming lead that you are testing so they can help and verify that your code works. (for merging to Github).
  • Raise robot so wheels do not touch the ground. (Wood blocks are in the wood workshop and design class) Or use the test board.
  • Connect to robot/board using a router. (Wireless or wired, your choice)
  • Turn on robot/board.
  • Test your code after the robot/board is clear of people.
  • Turn off robot/board.
  • Disconnect from robot.