|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
Ocyliptic
Rookie
Joined: Fri Mar 27, 2015 12:30 pm Posts: 2
|
 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!
|
Tue Sep 12, 2017 8:59 pm |
|
 |
CARBOT
Expert
Joined: Thu Dec 01, 2011 12:07 am Posts: 151
|
 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.
|
Fri Sep 15, 2017 9:35 pm |
|
 |
Ocyliptic
Rookie
Joined: Fri Mar 27, 2015 12:30 pm Posts: 2
|
 Re: Code structure
How do you tell the code to discriminate between significant actions and insignificant actions in a given loop?
|
Mon Sep 18, 2017 8:33 pm |
|
 |
Elohira
Rookie
Joined: Thu Jun 09, 2016 1:39 am Posts: 5
|
 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.
|
Fri Oct 13, 2017 5:34 am |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|