Date: Tue, 29 Jun 2010 12:37:54 +0100 From: Bruce Cran <bruce@cran.org.uk> To: Karsten Behrmann <BearPerson@gmx.net> Cc: freebsd-sysinstall@freebsd.org Subject: Re: Some design suggestions Message-ID: <20100629123754.00004ab1@unknown> In-Reply-To: <8CA80062-E8A7-40C3-B364-0493BDBBCD34@gmx.net> References: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net> <20100628115541.00002945@unknown> <8CA80062-E8A7-40C3-B364-0493BDBBCD34@gmx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 28 Jun 2010 13:32:17 +0200 Karsten Behrmann <BearPerson@gmx.net> wrote: > Not so. > I do not feel it makes much of a difference whether a variable resides > on the heap or somewhere in static data. > > Context structures are essential when you need something more than > once. However, I don't see us configuring two wholly distinct > partitionings inside the same sysinstall session. It *IS* singleton > state, and then we might as well store it easily into static > variables. > > I do not like having an extra state parameter to worry about, and > doing state->root_partition is just that little bit more for my eyes > to ignore than reading just root_partition. > > Of course, this is personal preference. But I do not believe (static) > globals should be unilaterally killed, they are quite useful. They > have these advantages over environment variables: > - arbitrarily typeable > - clear ownership/responsibility > - compiler enforces local-only access As long as the globals are declared in a single place and are restricted to the module, that sounds like a good idea: what I don't like is where globals are scattered throughout the file, some being declared at the top and some just before the function that uses them. I've worked on too many .NET projects with far too many fields that I've become very wary of globals! -- Bruce Cran
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100629123754.00004ab1>
