Hardcoded

Adjective · Slang & Abbreviations

Definitions

  1. A value embedded directly in source code rather than being read from configuration, environment variables, or a database. Sometimes the right call (gravitational constant), usually the wrong one (database password on line 47).

    In plain English: When a value is typed directly into the code instead of being stored in a setting that can be easily changed — quick but inflexible.

  2. The opposite of hardcoded is 'soft-coded' or 'configurable' — values read from environment variables, config files, or databases. The rule of thumb: if a value might ever change across environments (dev/staging/prod) or over time, it shouldn't be hardcoded.

    Example: 'The API URL is hardcoded to localhost:3000. Works great on your laptop, fails everywhere else. Move it to an environment variable.'

    Source: anti-pattern / configuration

Related Terms