View Single Post
  #12   Spotlight this post!  
Unread 11-08-2005, 13:57
Unsung FIRST Hero
miketwalker miketwalker is offline
Robot Lifeguard
FRC #1902 (Exploding Bacon)
 
Join Date: Dec 2001
Rookie Year: 2002
Location: Orlando, FL
Posts: 878
miketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond repute
Send a message via AIM to miketwalker
Re: Autonomous Code trouble

Quote:
Originally Posted by EricS-Team180
I ask my students to add a 2 letter prefix to variable names in order to keep the different scopes and types of variables sorted out. We don't touch the IFI variables, just the custom code we create...but that helps to identify IFIs code, as well:

First character:
t - type
m -data member of class, struct or
union (non-static)
s - static class scope
g - global scope
a - argument, non-reference
r - reference argument
l - auto local (temporary storage)

Second character:
n - number/scalar, non-enumeration
e - enumeration scalar
s - struct
u - union
a - array
p - pointer

So if we wanted to add a static int "t", it'd be snt and snT. If global, gnt or gnT or if used solely in a function lnt or lnT. It looks a bit awkward, but it really helps me when I'm code reading and debugging.

Eric
You should've told me that 3 years ago Eric, I would've understood your code much more then, I always wondered why you labeled your variables like you did. :-p
__________________
Chopsaw? Chopsaw.