Hard-coded data typically can be modified only by editing the source code and recompiling the executable, although it can be changed in memory or on disk using a debugger or hex editor.
Data that is hard-coded is best suited for unchanging pieces of information, such as physical constants, version numbers, and static text elements.
The term "hard-coded" was initially used as an analogy to hardwiring circuits - and was meant to convey the inflexibility that results from its usage within software design and implementation.
In the context of run-time extensible collaborative development environments such as MUDs, hardcoding also refers to developing the core engine of the system responsible for low-level tasks and executing scripts, as opposed to softcoding which is developing the high-level scripts that get interpreted by the system at runtime, with values from external sources, such as text files, INI files, preprocessor macros, external constants, databases, command-line arguments, HTTP server responses, configuration files, and user input.
In this case, the term is not pejorative and refers to general development, rather than specifically embedding output data.
Hardcoded credentials are usually not visible in configuration files or the output of account-enumeration commands and cannot be easily changed or bypassed by users.
If discovered, a user might be able to disable such a backdoor by modifying and rebuilding the program from its source code (if source is publicly available), decompiling, or reverse-engineering software, directly editing the program's binary code, or instituting an integrity check (such as digital signatures, anti-tamper, and anti-cheat) to prevent the unexpected access, but such actions are often prohibited by an end-user license agreement.
As a digital rights management measure, software developers may hardcode a unique serial number directly into a program.
Some "copy-protected" programs look for a particular file on a floppy disk or flash drive on startup to verify that they are not unauthorized copies.
Some Windows operating systems have so called Special Folders which organize files logically on the hard disk.
In many cases, a single hard-coded value, such as an array size, may appear several times within the source code of a program.
Similarly, careful programmers avoid magic numbers in their code, to improve its readability, and assist maintenance.
Abstracting too many values and features can introduce more complexity and maintenance issues than would be experienced with changing the code when required.
To avoid softcoding, consider the value to the end user of any additional flexibility you provide, and compare it with the increased complexity and related ongoing maintenance costs the added configurability involves.