View Single Post
  #3   Spotlight this post!  
Unread 25-12-2007, 00:25
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Programming style When to use Caps and Underscores?

I choose something like this:

Variables: Lower case with underscores. Lead with a letter.
Code:
int a_variable;
Functions: Lead with lower case letter, change words with caps.
Code:
x = getValue(y);
Macros: All caps.
Code:
#define    INPUT_A     5
Structures: Start with caps, underscore.
Structure instances: same as variable. (you could make this caps as well)
Code:
Motor_Controller left_side;
left_side->sensor = getEncoder(INPUT_A);

Last edited by Tom Bottiglieri : 25-12-2007 at 10:15.