Dan,

Some of your questions were answered by other people on the forum, I just
had a quick follow-up point:

Static functions are a really useful code organization tool. It really
helps identify functions that are local to a subsystem and thus should not
be visible to code that is outside of the subsystem. Thus these functions
are in effect "private" to one specific C module. In contrast, "public"
functions have a signature that is "published" in a common header file.
Other C modules that wish to call "public" functions simply include the
header file. If you were doing this in C++, you might instead make use of
private class member functions to achieve a similar result.

This kind of organization really pays off when you have a small project
that has grown into a bigger project, or if you are planning a big project
from the outset. Its awfully difficult to break a single huge C module into
multiple smaller C modules if everything (variables and functions) is a big
seething mass of globals. My view is its much easier to glue multiple
smaller modules together later on rather than be faced with breaking things
up, usually at the absolute worst and most inconvenient time.

Also note that this concept applies above and beyond Palm code, its just
good practice in software development.






Glenn Bachmann
Bachmann Software and Services, LLC
http://www.bachmannsoftware.com
Software for Handheld & Wireless Computing, Windows and the Internet
Authors of "Palm Programming", published by Macmillan/Sams, and home of
Bachmann Print Manager, the only graphical printing solution for the Palm
Computing Platform


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to