| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | coding style |
Sun 2003-03-30 19:56, Meikel Brandmeyer (2:244/1165) wrote to andrew clarke:
ac>> Put them all in a struct, eg.
ac>> static struct
ac>> {
ac>> word NumMacros;
ac>> }
ac>> glob;
MB>
ac>> It may be useful to calloc glob instead of using a static struct,
ac>> but you'd need to make this decision early on, because you'd then
ac>> need to use "glob->" instead of "glob."
throughout the code.
MB> Huh? I've never heard about this idea. Does this scheme have some
MB> nifty advantages? However the static idea won't work, or you have to
MB> put everything in large module. This is not feasible, I think....
Yes, all global variables would end up in the one module, which I think is
an advantage over having them scattered everywhere.
I don't know about nify advantages, but it fits your requirement of
prefixing names of globals.
MB> The init-function should be mandatory.
Yep.
MB> Every global variable should be explicitely initialised.
Probably. My point was that it's not strictly necessary, ie. you can get
away without doing it.
MB> We should put a STYLE into the distribution.
I think I'll leave that to you. ;-)
-- 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™.