From: Walton Hoops Date: 2009-12-22T10:57:40+09:00 Subject: Re: Symbols vs. constants? > -----Original Message----- > From: Young H. [mailto:armywide@gmail.com] > Hi, > > It seems to me a constant can be changed during the runtime. > > > Z="hello" > => "hello" > > Z=1234 > (irb):11: warning: already initialized constant Z > => 1234 > > Z > => 1234 > > So does it mean, it can be changed, but not encouraged? In fact it is greatly discouraged. There is never, ever a reason to change a constant once it is set. If you need something that acts like a constant, yet can be reassigned there is a construct for that: it's called a variable. Reassigning constants implicitly gives the next person to work on the code permission to beat you about the head with a large trout.