NEW: English for Tech Bundle → Save 40%
Your progress

Loading your progress…

Home
Code & Deliveryverb · /ˈhɑːrd koʊd/

hard-code

In simple English

Hard-coding refers to the practice of embedding literal values (like usernames, API keys, file paths, or database URLs) directly into your source code. While this might seem quick and easy during development, it creates several problems: the code becomes inflexible, it is difficult to change values for different environments (development, testing, production), and it can be a security risk if sensitive information is exposed in the code repository. In real tech workplaces, hard-coding is generally considered a bad practice. Developers are encouraged to use configuration files, environment variables, or dependency injection instead. You will often hear code reviewers ask developers to remove hard-coded values before merging code to the main branch. However, some constants that never change may be acceptable to hard-code. The term is used as both a verb (to hard-code something) and occasionally as an adjective (a hard-coded value). Understanding when and why to avoid hard-coding is an important skill for writing maintainable, professional-quality code.

Understand what hard-coding means in programming and why developers should avoid it.

At a glanceCEFR B2
Commonness4/5
Versatility4/5
FormalityCasualFormalNeutral
Spoken ↔ WrittenSpokenWrittenBoth
Directness ↔ DiplomaticDirectDiplomaticDirect
RegionUS and UK
New app · Free lessons

Speak up in meetings. Feel confident.

Standup vocabulary, native examples, and quick practice — 100+ free lessons

Start learning freeNo card needed · Google or email

Say it like this

We should not hard-code the API key.
I hard-coded the password by mistake.
Let us avoid hard-coding these values.

Real examples

in a code review

"This looks good, but please do not hard-code the server address. Use a config file instead."

in a standup

"We hard-coded some test values yesterday, but we need to fix that before production."

in a team meeting

"The previous developer hard-coded all the settings, which makes it impossible to deploy to different environments."

Don't say this

Handle with care. Do not confuse with simply writing code. Hard-coding specifically means embedding fixed values directly in code instead of using variables or configuration files.

We need to hard-code this feature into the system.
We need to implement this feature.Hard-code specifically refers to embedding fixed values, not implementing features. Use implement for features.
The URL is hard-coded in the application.
The URL is hard-coded in the code.Hard-code describes values in source code specifically, not the entire application.
Should we hard-code this constant?
Is it acceptable to hard-code this constant?When a value truly never changes, hard-coding might be acceptable. Phrase as a question rather than a statement of concern.

Other forms

verb (present tense)

hard-code

"We hard-code the API endpoint in the configuration module."

verb (past tense)

hard-coded

"The previous team hard-coded sensitive data into the source files."

adjective

hard-coded

"We need to replace these hard-coded values with environment variables."

Often used with

hard-code a valueTo embed a specific fixed value directly in code
hard-code a pathTo write a file path or URL directly into source code
hard-coded credentialsUsernames, passwords, or API keys written directly in code (security risk)
avoid hard-codingTo use configuration or environment variables instead of fixed values

Similar words

embedBroader term; hard-code is more specific to writing fixed values in code
bake inInformal synonym meaning to include something permanently in code

Opposites

parameterizeexternalizeconfigure

Practice

Try it

4 quick exercises

Pick the most natural phrasing

1. You find a username and password written directly in the code. What do you say in a code review?

Complete the sentence

2. During the migration, we accidentally _______ the database URL instead of using the config file.

Spot the mistake

3. Which sentence uses hard-code incorrectly?

Rewrite naturally

4. Rewrite using hard-code: We put the server address directly into the program code instead of putting it in a separate file where it can be changed easily.

Questions

Quick poll

Have you said "hard-code" in a standup this week?

Want more structured practice like this? Our English for Programmers course covers real workplace English in depth.

Your badges