General information
Category:
Coding, syntax & commands
I guess we'll have to agree to disagree, then. :)
I'd much rather see:
IF X = 1 && Some explanation
Than:
IF X = ccSomeConstant
To me, that's more readable.
Michelle
>I can see where a return value from a function documented in terms of a constant might be cause this sort of problem. For example, the Windows SDK defines the returns values with constants like ERROR_SUCCESS, ERROR_ACCESS_DENIED, etc. When debugging, seeing the actual value rather than the constant can be a problem. In the case of the Platform SDK, however, there is also a tool in Visual Studio that allows you to determine the meaning by simply entering the number.
>
>In an instance like this, however, the use of the constants in the call and checking of the return value is far more meaningful than actual values themselves. I believe that, "If it ain't readable, it ain't maintainable". So the overall readability, in my mind, is enhanced by the proper use of defined constants.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only