|
It was thus said that the Great Egor Skriptunoff once stated:
> On Mon, Jul 23, 2018 at 11:48 AM, Dirk Laurie wrote:
>
> > I call it first one "semi-global variables". All upvalues that are
> > intended to have scope of the entire file are collected near the top of
> > the program with no initializer. They tend to have fairly long,
> > descriptive names, not just 'x'.
>
> Declaring all "pseudo-global" variables at the beginning of a program isn't
> a good idea, IMO.
> (Even in Pascal you can declare a global variable anywhere in the code.)
> More convenient approach is to define a variable at the line where the
> variable is really starting to be needed.
I'm not sure what variants of Pascal you are used to, but for the ones I'm
used to, you can only declare new variables at the top of code block, not
anywhere in the code.