|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#10
|
||||
|
||||
|
Re: Do you write functions for your code?
Yep guys, Ken's right on the money with this one.
Functions are great for repeated routines that are called at different times with different arguments, but using functions just for the sake of using functions is wasting your CPU power! Every time you call a function, the processor has to push all its arguments and the return address onto the stack, goto the function address, execute the function, return to the main routine and clear the stack elements added. If the function is there just to make your code look pretty, you're wasting CPU cycles on the robot. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What is your most prefered programming language? | Hailfire | Programming | 156 | 19-01-2005 21:42 |
| Interrupt timer, executing code asap? | SeanCassidy | Programming | 10 | 07-03-2004 01:47 |
| Inserting Naviagation code into Default code? | actorindp | Programming | 3 | 28-01-2004 18:12 |
| RC bootup sequence | Venkatesh | Programming | 17 | 18-11-2003 20:56 |
| Does your team use the Default code. | Jeff McCune | General Forum | 2 | 09-01-2003 14:46 |