View Single Post
  #10   Spotlight this post!  
Unread 08-03-2004, 23:34
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
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.