Re: Global = root of all evil
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 02, 2006
- 576 views
Euman wrote: > > Hi all, > > Global vars, funcs, procs, etc.. root of all evil?? > > more so in C but in Euphoria as well.. > > Any takers?? > > personally I'm making sure my habits of using global's > extinct..for the most part.. Agreed. The more global items you have the more dependancies you create between files. And the more dependancies the harder it is to change things without upsetting something (or someone) else. A good rule of thumb (and this has been around since the 1970s) is eliminate every instance of module coupling, except where you absolutely must have for performance reasons (and that is almost never). This doesn't really apply to global constants though. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell