TIP: Click on subject to list as thread! ANSI
echo: artware
to: Meikel Brandmeyer
from: andrew clarke
date: 2003-03-31 08:44:48
subject: coding style

Sun 2003-03-30 22:17, Meikel Brandmeyer (2:244/1165) wrote to andrew clarke:

 MB> This works as long as the whole source code is in one module.
 MB> Otherwise you wouldn't have the same glob in two different modules.

Yeah, you're right.  I don't know what I was thinking there.  Just use
memset(&glob, 0, sizeof glob) in the initialiser.

 MB> I had something more descriptive in mind. The prefix tells where the
 MB> functions comes from. In some sense object oriented. AreaOpen(),
 MB> AreaClose(), etc. (as example) do something with areas and come from
 MB> area.c. The prefix |--> file mapping isn't that important, but this
 MB> gives a good division of the source code. I hope you get my meaning.

Yep.  That's good for function naming.  For global variables you can have a
hierachy, eg. glob.area.count, glob.macros.count, etc.

-- mail{at}ozzmosis.com

--- timEd/FreeBSD 1.11.a5
* Origin: Blizzard of Ozz, Mt Eliza, Victoria, Australia (3:633/267)
SEEN-BY: 633/267 270
@PATH: 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.