C: Global Variables versus Parameters

Nibbie
Posts: 4
Joined: 2010.01
Post: #1
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?
Quote this message in a reply
Post Reply 


Messages In This Thread
C: Global Variables versus Parameters - Lizard Man - Jan 12, 2010 08:20 PM
C: Global Variables versus Parameters - DoG - Jan 13, 2010, 05:03 AM
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