Syd wrote:

>Hi guys , I'm not sure what indentation style you are referring to ,
>and I have warned everyone it's been a long time since I have done any
>programming .... self taught ,I'm afraid .... so if there is a proper
>way to code I guess I missed it along the way:).
>I'm more concerned with getting things working than how pretty my
>lines of code look, so I suppose it might be a bit disorganized. 
>
>  
>
[...]

>Cheers,
>Syd 
>  
>  
>
Greetings, FG Dev-List.

By way of introduction, I worked here http://rencorp.com/ from 1986 to 
2004 doing industrial automation/controls and embedded programming for 
automated testing equipment in C/C++ and various flavors of assembly 
language.  I'm qualified to talk programming, closed-loop controls, 
instrumentation, networking and automation in general. I am not 
qualified to talk aero, but I have a sister who is (aero engineer at 
Boeing since '84).  OK, enough of that.

Syd, here's a summary of common coding styles: 
http://www.komputado.com/eseoj/1tbs.htm

A quick review of some of FG's source reveals (surprise!) a mixture of 
styles. I suggest choosing a style that feels comfortable from the link 
above and sticking with it.  I originally used the "K&R" style because 
that little white book was my first exposure to C. If it was good enough 
for Kernighan and Ritchie... The style I've used for the last 15 years 
or so appears to be called the "BSD/Allman" style.  Just my personal 
favorite (3 spaces indent for me, no tab characters please).

Not addressed by that link above are comments/documentation.  I've 
managed complex coding projects, and sometimes had to dredge up 10 to 20 
year old code.  Succinct and informative comments are critical.  
Variable and function names can be informative too:

// the following is not helpful to someone who's never seen the code before
void func2a(void)
{
   i++;   // increment i
}

// the following *is* helpful to someone who's never seen the code before
void NextJoke( void )
{
   JokeRecordIndex++;   // point to next joke in the database
}

Adios,

-- 
Reagan Thomas



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to