hard coding

Embedding fixed values

Hard coding is embedding fixed values directly into a program's source code rather than making them configurable or dynamic.

A hard-coded password can't be changed without modifying the code itself.

The practice is generally discouraged because it reduces flexibility: The file path was hard-coded, so the program broke when we moved servers.

Also spelled as one word: hardcoding.

inflexibility

brittle

Liable to shatter

unadaptable · hardwired · embedded · unchangeable · permanent · immutable · concrete · stiff · locked · baked-in

inefficiency

cumbersome

Awkwardly heavy or bulky

redundant · laborious · error-prone · repetitive · unscalable · unwieldy · verbose · duplication · copy-paste · boilerplate

antipattern

unmaintainable

Cannot be kept functional

workaround · hack · kludge · band-aid · configuration · constants

Categories
Opposites
configurability

hard codingconfiguration

Arrangement of parts

externalization · configurable · customizable · flexible

abstraction level

hard codingabstraction

Distilling to essential qualities

generalization · templating · indirection · metaprogramming · polymorphism

data source

hard codingdata-driven

Informed by collected information

user input

Family

hard, coding, code, harder, hardest, harden, hardness, hardly, hardened

Familiarity
Top 500,000
Profile
Used worldwide · Timeless · Rated G