View Single Post
Old Jan 24th, 2007, 10:20 PM   #2
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
Function Calls: Function call overhead is quite high in python compared to compiled to languages like C or C++. Yet this really does not matter until you start to hit performance problems. Functions let you reuse code that you would other wise have to write twice, and they let you clarify complicated tasks by breaking it into manageable junks.

Classes and Globals:
There are very few reasons for globals, just make them class members. I use classes for organization. In my current project, a 3D simulation, I have classes devoted to physics, graphics, input and so on. I am sure others will be able to give you a better ideas/recommendations.

Comments:
See the python style guide line.
__________________
Robotics @ Maryland AUV Team - Software Lead
Game_Ender is offline   Reply With Quote