Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,707 of 33,346    |
|    Peter Schneider to goran.pusic@googlemail.com    |
|    Re: Singletons    |
|    05 Dec 12 23:04:48    |
      From: schneiderp_REMOVETHIS@gmx.net              Hi,              On 04.12.2012 12:40, goran.pusic@googlemail.com wrote:              > There is no such thing as "global state",       > except in simplest of programs.              A bold statement. Can you briefly elaborate? I'd say       that almost *all* C++ programs have global state:              In my opinion every "normal" program on "standard"       machines has implicit global state       (in form of general system ressources       like memory, word size, byte sex, CPU load and cores       as well as the state of the stack,       the instruction pointer etc.),       and C++ programs specifically have automatically       global state as soon as you link to the       C++ libraries or just run in a C++ runtime environment       (e.g. command line params, standard streams).              It seems natural that the overall runtime "environment"       (in a broad sense) of a program is accessible from       anywhere in a program. (One may, for design and       maintainability, choose not to access it, of course,       but one can).              And only then are we talking about explicit global state       (global resources, configurations, whatever)       which may or may not be legitimate but surely do exist       in many programs.              So I'm (genuinely) curious what made you say that.              Regards, Peter                     --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca