[colug-432] Great moments in computer science

R P Herrold herrold at owlriver.com
Wed Jun 3 12:09:27 EDT 2015


On Wed, 3 Jun 2015, Steve VanSlyck wrote:

> In words of one syllable, what is basically the problem with 
> global variables? Is it simply that they're open to be 
> changed by anything in the system?

the linked trial transcripts are pretty readible to a lay 
person (the expert witness did s good job 'cutting through' 
the lingo -- recommended reading

coders have long known better (sorry, two syllables) than to 
keep food, rat poison, and baby powder all in the same old 
re-used coffee can in the refrigerator.  A 'global' is a 
re-use of a storage location without taking the time to make 
sure it is in a (type-system protected -- sorry, a 'forward 
reference' I will define a bit later) and distinctively named 
container

Used properly and maturely, their tools will protect them by 
limiting (confine) the area for mistakes to happen if they are 
properly used, just as keeping the rat poison in the original 
packaging with skull and cross-bones on the top shelf in the 
garage, the food in the 'fridge, and the baby powder in the 
nursery prevents mixup and 'accidents'

Variable names are cheap; the techniques to let the computer 
code detect when rat poison leaves the garage and ends up 
stored in the nursery exist (called being in and out of scope 
-- things OUT of scope are inaccessible automatically unless 
declared as 'global')

'typed' (type-system protected) languages add further 
protective inter-locks to prevent error

undefined (net yet defined) 'forward references' also noted 
here.  When building an presentation, one does not want to 
leave an audience guessing as to what a term of art means, but 
there is a geek joke buried there, from compiler design 
courses, that show how to solve and teach naiive compilers to 
be able to note sonething they do not understand yet, and then 
to 'fix-up' the uncertainty in a second read through (or 
'pass') through the material

People asre not so patient or literal as computers, so it 
makes sense not to use a term of art, without also then 
'dropping a footnote' with a definition

-- Russ herrold


More information about the colug-432 mailing list