Yes, but practically you don't need to use constants. It is just a matter of definition and design as I said. As a programmer, you control what happens with the variables. It is not like you have to protect your software against yourself or something.d11wtq wrote:Put simply....
You use constants where the value never needs to change
Use variables where the data can change (i.e. variable)
Coding in other languages perhaps makes the distinction clearer
Why use constants?
Moderator: General Moderators
-
Jeroen Oosterlaar
- Forum Commoner
- Posts: 37
- Joined: Sun Nov 06, 2005 4:12 pm
You might have to if you have multiple personality syndrome... your other personality might want to change that variable to be mean.Jeroen Oosterlaar wrote:Yes, but practically you don't need to use constants. It is just a matter of definition and design as I said. As a programmer, you control what happens with the variables. It is not like you have to protect your software against yourself or something.d11wtq wrote:Put simply....
You use constants where the value never needs to change
Use variables where the data can change (i.e. variable)
Coding in other languages perhaps makes the distinction clearer
-
Jeroen Oosterlaar
- Forum Commoner
- Posts: 37
- Joined: Sun Nov 06, 2005 4:12 pm
One armed space goat wrote:You might have to if you have multiple personality syndrome... your other personality might want to change that variable to be mean.Jeroen Oosterlaar wrote:Yes, but practically you don't need to use constants. It is just a matter of definition and design as I said. As a programmer, you control what happens with the variables. It is not like you have to protect your software against yourself or something.d11wtq wrote:Put simply....
You use constants where the value never needs to change
Use variables where the data can change (i.e. variable)
Coding in other languages perhaps makes the distinction clearer