Monday, August 8, 2011

Chapter 3, question 4

4.  What are the two advantages of using a symbolic constant instead of a literal constant?

If I want to change the number, I only need to change it once rather than multiple times.
A symbolic constant can be named so that I know what the number does rather than having an unexplained magic number.
It probably makes the code easier to read and debug.

No comments:

Post a Comment