Main Content
Global and Enable - two misused words! Archive - Originally posted on "The Horse's Mouth" - 2009-11-30 18:07:14 - Graham Ellis
The word global is used in declaring variables in some languages such as Tcl and Python to indicate that the variable being referred to is shared with the variable of the same name at the top scope. To use the word global, which implies that the declaration makes the variable visible everywhere, is misleading
The word enable is used in places such as the Apache http server build process to request that a facility is included within the build. But it does not mean that the facility is actually switched on and usable when the build has been done - other quite separate configuration work is needed to truly enable it!
I have some sympathy with the people who have to come up with words to describe what these words actually do - I'm not sure if I would have done any better; I do know that I have to be very careful when explaining "Global" and "Enable" on our courses.
Some other articles
Y105 - Functions, Modules and Packages From and Import in Python - where is the module loaded from? Embedding more complex code into a named block Nesting decorators Recursion in Python - the classic example What are callbacks? Why use them? An example in Python What is the difference between a function and a method? Reading command line parameters in Python A good example of recursion - a real use in Python Python - even named code blocks are objects Multiple yields and no loops in a Python generator? Python functions - an introduction to how they work Python varables - checking existance, and call by name or by value? Exception, Lambda, Generator, Slice, Dict - examples in one Python program vargs in Python - how to call a method with unknown number of parameters Optional positional and named parameters in Python Default local - a good choice by the author of Python Static variables in Python? Python timing - when to use a list, and when to use a generator Functions are first class variables in Lua and Python Finding all the unique lines in a file, using Python or Perl Python Packages - groupings of modules. An introduction Static variables in functions - and better ways using objects Passing optional and named parameters to python methods Catching the fishes first? Passing parameters to Python functions - the options you have Returning multiple values from a function call in various languages - a comparison Using an exception to initialise a static variable in a Python function / method Python - some common questions answered in code examples Passing a variable number of parameters in to a function / method Program for reliability and efficiency - do not duplicate, but rather share and re-use Optional and named parameters to Python functions/methods Python - access to variables in the outer scope This article Good example of recursion in Python - analyse an RSS feed Sample code with errors in it on our web site Optional parameters to Python functions Multiple returns from a function in Python Conversion of OSI grid references to Eastings and Northings Dynamic code - Python Optional and named parameters in Python What to do with a huge crop of apples Anonymous functions (lambdas) and map in Python Sharing variables with functions, but keeping them local too - Python Global - Tcl, PHP, Python Python Script - easy examples of lots of basics Returning multiple values from a function (Perl, PHP, Python) A better alternative to cutting and pasting code Function / method parameters with * and ** in Python It's the 1st, not the 1nd 1rd or 1th. Sludge off the mountain, and Python and PHP Python - A list of methods Recursion in Python Python - function v method Dynamic functions and names - Python Do not duplicate your code Cottage industry or production line data handling methods Python modules. The distribution, The Cheese Shop and the Vaults of Parnassus. Python - block insets help with documentation Python's Generator functions Difference between import and from in Python What is a callback? Code and code maintainance efficiency Call by name v call by value Lambdas in Python Python generator functions, lambdas, and iterators Distance Learning Variable Scope T207 - Procedures and Variable Scope Accessing variables across subroutine boundaries - Perl, Python, Java and Tcl Sharing lots of values in Tcl without having lots of global declarations Passing back multiple results in Tcl - upvar and uplevel Tcl - Some example of HOW TO in handling data files and formats Passing a variable number of parameters in to a function / method This article Tcl - uplevel to run code at calling level Tcl - passing arrays and strings in and back out of procs Calling procs in Tcl and how it compares to Perl Tcl - global, upvar and uplevel. A better alternative to cutting and pasting code Do not duplicate your code Functions and commands with dangerous names Call by name v call by value Passing arrays to procs in Tcl Variable Scope G998 - Newsletter Highlighted Box Web Sites - Subject to Advertising Standards from 1st March - check your sites This article Are you wanting to learn PHP? Reading all our recent news from a single source A (biased?) comparison of PHP courses in the UK We have lost a regular business guest Why the Pony Tail? LinkedIn - Thrice Asked, and joined. How many cups of coffee? Public Training Course Dates until July 2009 A short introduction to our courses Linux and Java Course in London Evening drive across the roof of Wiltshire Tcl/Tk - updating your display while tasks are running Python v Ruby Troy, up state New York What proportion of our web traffic is robots? Well House Manor, Melksham, Art Gallery ls -l report, Linux / Unix - types and permssions Well House Manor and Beechfield House, Hotels, Melksham A602 - Apache httpd - Sourcing, Installation, Testing Adding a PHP build option, rotating an image based on camera data, and a new look at thumbnails in PHP Automed web site testing scripted in Ruby using watir-webdriver This article Choosing the right version of Java and Tomcat Where is my new Apache httpd installed Using ApacheBench and jconsole to test and monitor Tomcat Summary - Apache httpd build on Linux What is built in to this httpd and PHP? Apache httpd, MySQL, PHP - installation procedure Configuring Apache httpd Connecting to MySQL 5 from PHP on Mac OSX Leopard Upgrade Mac OSX to Leopard, Web Server Apache httpd config lost DHCP automatic IP address v Static IP Apache httpd , browser, MySQL and MySQL client downloads Notes from the white board Browser -> httpd -> Tomcat -> MySQL. Restarting. Stopping and restarting Apache httpd cleanly 2006 - Making business a pleasure Apache httpd - serving web documents from different directories Apache httpd release 2.2