Hardcode

Why Trust Techopedia

What Does Hardcode Mean?

A hardcode is a part of a computer program which cannot be altered in any way except by changing the source code of the program itself.

Advertisements

This means that if the software has already been compiled and made into an executable, the hardcoded portion of the program stays constant no matter what is done to the software. This is usually done for certain fixed parameters and values that should always be constant, like Pi or the speed of light.

The process of creating a hardcode is known as hardcoding.

Techopedia Explains Hardcode

Only certain portions of a program can be hardcoded and the most basic examples are constant values, especially those used in the sciences like physics and chemistry, as well as math in general. A hardcode has one purpose, and that is to ensure that the value being hardcoded cannot be changed during run time of a program.

Some developers consider hardcoding to be a bad programming practice, but it does have some merits and appropriate uses. For example, sometimes unique serial numbers are hardcoded to software to ensure validity of the copy.

Advertisements

Related Terms

Margaret Rouse
Technology Specialist
Margaret Rouse
Technology Specialist

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.