Making one value "special"
Posted
by
SplashHit
on Stack Overflow
See other posts from Stack Overflow
or by SplashHit
Published on 2010-12-22T21:24:27Z
Indexed on
2010/12/22
21:54 UTC
Read the original article
Hit count: 120
refactoring
|code-smell
What is the "computer science" term for the practice of assigning a special meaning to one of a type's values. For example a numeric variable called "amount_to_transfer" where the special value "0" means "entire account balance" or a date value "spouse_date_of_birth" where "1/1/1800" means "unmarried".
I happen to feel that this is quite a bad "smell", but I'd like to have a name for it, and if possible, some blog post or article about why it's bad and how to fix it.
© Stack Overflow or respective owner