[LON-CAPA-dev] Globals considered harmful (was A lesson in globals)

Ron Fox lon-capa-dev@mail.lon-capa.org
Mon, 31 Mar 2003 12:48:59 -0500


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

An even larger issue with globals is that they tie the implementation
to them.
Far better to provide acessing functions to any global data that hide
the form and structure of the data from the 'client'. For example:

my $client;

# yada yada yada

proc GetClient {
  return $client;
}

Now nobody knows how this piece of data is maintained except those
reponsible
for maintaining it.  This is >good<

Ron

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPoh/i094N2h8GnCnEQKnvACgkzn51OdcPt9oO4fy3AmQZh/2Lh8AoPGz
IofKD5+7n+HklgpBdB+7+UfH
=n0a/
-----END PGP SIGNATURE-----