Richard Ward writes:

Where/why would one use a typed constant vs. a variable.  i.e.

Any time you have a value you want to have in an accessible holder, but want to ensure you will not change it's value by mistake.
It seems to me the typed constant is superfluous and can potentially lead to bugs.

On the contrary. They help saveguards against bugs.
Imagine a team of people working on different parts of a large system.
One team defines a constant; someone on another team sees a piece of code and thinkgs he working with a variable. He tries to change it and the compiler throws an error because it is a constant. That error just saved that system from a logical, possibly hard to find, error.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to