TIP: Click on subject to list as thread! ANSI
echo: artware
to: andrew clarke
from: Meikel Brandmeyer
date: 2003-03-30 22:17:28
subject: coding style

Hi,

 ac> Yes, all global variables would end up in the one module, which I
 ac> think is an advantage over having them scattered everywhere.
One moment. I understand this in the following way:

static struct globalvars glob;

int foo()
{
     return glob.a;
}

int bar()
{
     return glob.b;
}

This works as long as the whole source code is in one module. Otherwise you
wouldn't have the same glob in two different modules. Then it's not global
and you don't need it at all. Or I don't understand what you mean with
"static". (module reads source file in C or is there some way to
change this, I'm not aware of)
 
 ac> I don't know about nify advantages, but it fits your requirement of
 ac> prefixing names of globals.
I had something more descriptive in mind. The prefix tells where the
functions comes from. In some sense object oriented. AreaOpen(),
AreaClose(), etc. (as example) do something with areas and come from
area.c. The prefix |--> file mapping isn't that important, but this
gives a good division of the source code. I hope you get my meaning.

Ciao
Meikel

--- timEd/FreeBSD 1.11.a5
* Origin: -=[ Ceres/BSD (Kaiserslautern, Germany) ]=- (2:244/1165)
SEEN-BY: 206/0 633/267 270
@PATH: 244/1165 1200 2432/200 774/605 123/500 106/2000 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™.