Science Fair Project Encyclopedia
Hard code
Hard-code refers to the software development practice of embedding fully expanded string references directly into the source code of a program or other executable object, instead of indirect references.
Considered a deprecated practice by most practitioners of the software art, it requires that the program code be changed any time that the value in the string changes, when it might be more convenient to the end user to change the detail by some means outside the program.
For example, a hard-coded reference to a computer file would point to a specific file in a specific location on disk. If the file's location changed, the program code itself would have to be changed to find the file in the new location. An indirect reference, such as a variable inside the program called "FileName", could be expanded by accessing a "browse for file" dialogue window, and the program code would not have to be changed if the file moved.
Hard coding is especially problematic in preparing the software for translation to other languages.
Hard code is generally considered an anti-pattern.
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details


