Jump to content

Hard coding

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 202.2.56.50 (talk) at 22:55, 8 December 2004. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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 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 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.