C: Global Variables versus Parameters
I am reading "Learn C on the Mac" by Dave Mark, which I am finding to be a good book. However, Mark states that global variables are to be avoided if possible, and that it is better to use parameters. Is this correct? His book doesn't really explain why they should be avoided, other than saying that "they do save time but at the cost of proper program design."
Global variables seem a lot easier to grasp and use than parameters. Is using global variables really considered improper program design? Why?
Global variables seem a lot easier to grasp and use than parameters. Is using global variables really considered improper program design? Why?
| Messages In This Thread |
|
C: Global Variables versus Parameters - Lizard Man - Jan 12, 2010 08:20 PM
C: Global Variables versus Parameters - AnotherJake - Jan 12, 2010, 08:50 PM
C: Global Variables versus Parameters - AnotherJake - Jan 12, 2010, 09:04 PM
C: Global Variables versus Parameters - NelsonMandella - Jan 12, 2010, 10:46 PM
C: Global Variables versus Parameters - AnotherJake - Jan 12, 2010, 10:57 PM
C: Global Variables versus Parameters - DoG - Jan 13, 2010, 05:03 AM
C: Global Variables versus Parameters - Skorche - Jan 13, 2010, 08:19 AM
C: Global Variables versus Parameters - NelsonMandella - Jan 13, 2010, 11:22 AM
C: Global Variables versus Parameters - AnotherJake - Jan 13, 2010, 11:41 AM
C: Global Variables versus Parameters - Najdorf - Jan 13, 2010, 01:14 PM
C: Global Variables versus Parameters - Lizard Man - Jan 13, 2010, 08:22 PM
|
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Accessing an inherited class's variables | Tobs_ | 22 | 8,398 |
Feb 28, 2007 05:26 PM Last Post: mac_girl |
|
| Problems with variables in Obj-C | vnvrymdreglage | 16 | 5,946 |
Oct 2, 2006 10:19 PM Last Post: vnvrymdreglage |
|
| Should global variables be pointers or full objects? | ia3n_g | 1 | 2,067 |
Aug 4, 2006 05:53 PM Last Post: OneSadCookie |
|
| where do global variables fall into the memory type? | WhatMeWorry | 3 | 2,526 |
Jun 5, 2006 02:45 PM Last Post: OneSadCookie |
|
| Arrays or variables containing executable functions | Jones | 4 | 3,758 |
Jun 2, 2006 08:35 AM Last Post: Zekaric |
|

