liveBook · Manning

Hardcoding

Also called hardcode, hardcoded, hard-coding

Hardcoding is embedding fixed values, rules, configuration, or behavioral choices directly in code or another artifact rather than supplying or deriving them separately.

How 2 Manning books explain it

Build Financial Software with Generative AI (From Scratch)

A hardcoded value is a literal configuration or data value embedded directly in source code or another fixed artifact instead of being supplied dynamically.

How it is used
Uses hardcoding as both a configuration risk to remove and a temporary shortcut for application prototypes.
How deep it goes
Explains security and maintenance concerns and walks through replacing database credentials with environment variables.
Examples
Uses PostgreSQL credentials, fixed FastAPI responses, ACH upload rows, and a login with hardcoded users.
What you can do after
Operate/configure Docker services to supply database credentials through environment variables instead of embedding them in application code.

Read how Build Financial Software with Generative AI (From Scratch) explains hardcoding →

Data-Oriented Programming in Java

Hard coding is embedding environment-specific values or infrastructure assumptions directly in application code.

How it is used
Exposes hidden coupling in test fixtures and integration-test files, then redirects tests toward visible, data-driven inputs.
How deep it goes
Diagnoses gradual coupling and demonstrates generation, parameterization, serialization, and randomization, stopping short of general application-configuration treatment.
Examples
Uses shared Account helpers, fixed CSV paths, generated rows, serialized files, and scalable Stream.generate datasets.
What you can do after
Diagnose brittle tests and replace hidden fixtures or files with parameterized, generated data whose assertions reflect explicit inputs.

Read how Data-Oriented Programming in Java explains hardcoding →

Also covered in

What to know first

Related concepts

Questions about hardcoding

What is hardcoding?

Hardcoding is embedding fixed values, rules, configuration, or behavioral choices directly in code or another artifact rather than supplying or deriving them separately.

Which Manning books explain hardcoding?

Build Financial Software with Generative AI (From Scratch) and Data-Oriented Programming in Java.

What should I know before learning hardcoding?

Manning books that teach hardcoding usually introduce software testing, function, HTTP request and inheritance first.

What is the difference between hardcoding and dynamic expected value?

Hardcoding is embedding fixed values, rules, configuration, or behavioral choices directly in code or another artifact rather than supplying or deriving them separately. A dynamic expected value is a test expectation computed by executing logic rather than specified directly as a fixed value.

What is hardcoding also called?

Hardcoding is also called hardcode, hardcoded or hard-coding.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.