Talk:Magic string
![]() | Computer science Start‑class Low‑importance | ||||||||||||||||
|
ISTM another plausible meaning of "magic string" is just like a magic number but a string instead. This would be a string used to store information that would be better stored using symbolic constants or possibly a boolean variable.
And the string could be purely internal, or it could be in a UI component. The latter is a bit like the kind of magic string that the article talks about, except that rather than being in a text input control, it might be in the text label of a button or the like (this is a form in which I have recently encountered it). That said, maybe this is just one case of a more general kind of anti-pattern for which there ought to be a name: storing state information in GUI controls for later retrieval.
Comments? -- Smjg (talk) 19:38, 16 December 2008 (UTC)