ROBOTC.net forums
http://www.robotc.net/forums/

Code structure
http://www.robotc.net/forums/viewtopic.php?f=11&t=19572
Page 1 of 1

Author:  Ocyliptic [ Tue Sep 12, 2017 8:59 pm ]
Post subject:  Code structure

How do you structure your code? What I mean by this is what's your program's workflow? Do you have everything in one file, or do you spread everything out over multiple files and use the #include function?

I'm hoping to plan out a new structure for our team's code this year and would love ideas. Thanks in advance!

Author:  CARBOT [ Fri Sep 15, 2017 9:35 pm ]
Post subject:  Re: Code structure

A pet peeve of mine is code that ties up the processor simply waiting for a single event. I frequently write state based code using the select/case statement. This allows the overhead code to be scanned very frequently. This also allows code to be broken into very small sections with specific actions.

Author:  Ocyliptic [ Mon Sep 18, 2017 8:33 pm ]
Post subject:  Re: Code structure

CARBOT wrote:
A pet peeve of mine is code that ties up the processor simply waiting for a single event. I frequently write state based code using the select/case statement. This allows the overhead code to be scanned very frequently. This also allows code to be broken into very small sections with specific actions.


How do you tell the code to discriminate between significant actions and insignificant actions in a given loop?

Author:  Elohira [ Fri Oct 13, 2017 5:34 am ]
Post subject:  Re: Code structure

We do it both ways. If we use include files they will comprise a single function (#include autonSelectMenu.c) and we do it just to make the code more readable. Because the #include is a compiler directive, it doesn't matter during runtime, and is only for the convenience of the programmer.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/