What's wrong with Globals?

Jim Ault JimAultWins at yahoo.com
Mon Apr 2 22:31:14 EDT 2007


Just a quick perspective, nothing long or involved, and no code.

Off the top of my head I think there are a few people who would like custom
properties and grok them right away
--object oriented programmers (OOP) like Flash
--database designers, organizing lots of related tables
--graphic designers.  Yep, graphic designers

Anyone who is proficient with Photoshop works with images in layers.  Each
layer can have numerous properties (visible, opacity, blend level, gradient,
pixels).  This is essential in their work.  It is a visual array of
properties stored with each layer.

Three layers can have exactly the same properties (copies of each other)
except layer number.  Three buttons in Rev can have exactly the same custom
properties, and the same built-in properties except number, id, and layer.

I agree that your style of programming is better served by using globals.
There are pitfalls and extra attention to detail required for both methods.

Jim Ault
Las Vegas


On 4/2/07 3:27 PM, "Joe Lewis Wilkins" <pepetoo at Cox.Net> wrote:

> Graham and everyone else who is interested or should be,
> 
> Since I started this thread with what I thought was a fairly naive
> question with a pretty obvious conclusion, perhaps I should summarize
> the input - if that is possible, what with some of the quite lengthy
> monologues.
> 
> I believe that Richard and Jim have made the most poignant arguments
> both for and against the use of globals; and I was leaning very
> sharply in the CP direction until Graham made a very good point: CPs
> do tend to involve writing a lot more code, and I have to learn
> something that I've not used before; hence probably subject to some
> errors in usage on my part - typos and otherwise.
> 
> So I intend to learn the CP approach down the road a bit, but
> continue in the meanwhile with my use of Globals as I have in the
> past. The code for CPs IS pretty "elaborate" and not totally
> intuitive; at least to me. I can definitely see some advantages to
> the CP approach, but maybe I'm too far gone to change at this point
> in my life. Hey! I wouldn't even be using RR at all were it not for
> Apple's failure to support HC on OSX. I used HC last night to make a
> material list that I needed to parse and get to the manufacturer this
> morning. It didn't need to be cross platform or even in color, so...
> Of course I did it on my 9.2 Mac; something I'll probably keep around
> for many years to come, though I'd love to get a new one on which I
> can run 9.2. It was a great OS!
> 
> Thanks to everyone for their opinions and perspectives. I think  we
> all learned a lot.
> 





More information about the use-livecode mailing list