Thread: "White space"
View Single Post
  #20   Spotlight this post!  
Unread 19-03-2009, 00:18
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: "White space"

Sorry I didn't specify, adding or removing code does not change the weight!!

Anyways, here's some sample code from my joystick for FTC, this is how I like things whitespaced

Code:
while (true) { //whitespace after an important conditional or loop

  getJoystickSettings(joystick); //single linebreak for basic commands and function calling
  setMotors("default"); //double linebreak when another main conditional is about to appear

  if (joystick.joy1_y1 > 40 || joystick.joy1_y1 < -40) { //single linebreak for a final conditional in nests
    motor[motorD] = joystick.joy1_y1; 
  }

}