释义 |
hard-coded hard-coded (jargon)(By analogy with "hard-wired") Said of a data valueor behaviour written directly into a program, possibly inmultiple places, where it cannot be easily modified. Thereare several alternatives, depending on how often the value islikely to change. It may be replaced with a compile-timeconstant, such as a C "#define" macro, in which case achange will still require recompilation; or it may be read atrun time from a profile, resource (see de-rezz), orenvironment variable that a user can easily modify; or itmay be read as part of the program's input data.
To change something hard-coded requires recompilation (ifusing a compiled language of course) but, more seriously, itrequires sufficient understanding of the implementation to besure that the change will not introduce inconsistency andcause the program to fail.
For example, "The line terminator is hard-coded as newline;who in their right mind would use anything else?"
See magic number. |