From cyc||cgroup-z1 @end|ng |rom y@hoo@com  Wed Aug 28 05:16:13 2019
From: cyc||cgroup-z1 @end|ng |rom y@hoo@com (Cyclic Group Z_1)
Date: Wed, 28 Aug 2019 03:16:13 +0000 (UTC)
Subject: [Rd] Conventions: Use of globals and main functions
In-Reply-To: <CAB8pepy-b3v+fdTrT6=ZpkXCXPhV14_Oi5=h1AaOB_A=-F7E+A@mail.gmail.com>
References: <1118624909.2128031.1566706119596.ref@mail.yahoo.com>
 <1118624909.2128031.1566706119596@mail.yahoo.com>
 <CAB8pepy-b3v+fdTrT6=ZpkXCXPhV14_Oi5=h1AaOB_A=-F7E+A@mail.gmail.com>
Message-ID: <1879879765.3690756.1566962173280@mail.yahoo.com>

Definitely, I agree that global variables have a place in programming. They play an especially important role in low-level software, such as embedded programming, as you mentioned, and?systems programming. I generally would disagree with anyone that says global variables should never be used, and they may be the best implementation option when something is "truly global."

However, in R scripting conventions, they are the default. I don't think it is controversial to say that in software engineering culture, there is a generally held principle that global variables should be minimized because they can be dangerous (granted, the original "Globals considered harmful" article is quite old, and many of the criticisms not applicable to modern languages). I do think it is equally important, though, to understand when to break this rule.

I like your suggestion of documenting this as an alternative option, though it seems the general sentiment is against this, which I respect.

Best,
CG



[Rd] Conventions: Use of globals and main functions
Cyclic Group Z_1