Hard-Coded Value
noun
say it: “HARD KOH-did VAL-yoo” /ˈhɑrd ˈkoʊdɪd ˈvælju/
A value written directly into a program's code, so changing it means editing that code.
What is a hard-coded value?
A hard-coded value is a value typed straight into the code, such as a file name or a count, so changing it means finding and editing that line. Making it a parameter, or reading it from settings, lets the same code work for the next file or number.
week = pd.read_csv("data/incoming/week-2026-09-07.csv") # hard-coded: always this one week
def load_week(path): # the file is now a parameter
return pd.read_csv(path)
In a sentence
- “The file name was a hard-coded value, so every week someone edited the script.”
- “He turned the hard-coded value 3 into a parameter.”
Level: Apprentice · More Software Development terms at this level
Updated