Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Autonomous Code trouble (http://www.chiefdelphi.com/forums/showthread.php?t=34569)

jazzsaxman1988 23-09-2005 09:21

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
So yeah, good example of using the basic idea behind Hungarian notation. It's good that you make your students do it, it makes for much easier code reading, and it keeps you from ripping your hair out trying to fix things. The code for FRC isn't so bad, but when you get into Windows programming it really makes a difference.

The yellowdart 21-01-2006 10:36

Re: Autonomous Code trouble
 
There is a way to make MPLAB recognize that......I'll look it up and let ya know how to do it.


All times are GMT -5. The time now is 19:16.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi