View unanswered posts | View active topics It is currently Sat Dec 16, 2017 4:50 pm






Reply to topic  [ 4 posts ] 
Code structure 
Author Message
Rookie

Joined: Fri Mar 27, 2015 12:30 pm
Posts: 2
Post 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
Profile
Expert

Joined: Thu Dec 01, 2011 12:07 am
Posts: 151
Post 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
Profile
Rookie

Joined: Fri Mar 27, 2015 12:30 pm
Posts: 2
Post 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?


Mon Sep 18, 2017 8:33 pm
Profile
Rookie

Joined: Thu Jun 09, 2016 1:39 am
Posts: 5
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.