|
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.
|