Encyclopedia

hard coded

Also found in: Dictionary.

hard coded

(1) A part of a program that has been declared as unchanging. For example, a constant is hard coded and remains the same throughout the execution of the program.

(2) Programming code that solves a problem but offers less flexibility for future changes. Hard coding may get the job done, but it can be thought of as "brute force" programming. The degree to which a program is hard coded determines how difficult it will be to modify later when new types of data are introduced or new functions are added.

Easier and Faster
Very often, an application is hard coded first and generalized later. The reason is simple. It is always easier and faster to hard code a solution than to write a generalized routine that handles a variety of possibilities.

Hard Coding vs. Hand Coding
Hard coding and "hand coding" are not the same thing. Hard coding refers to writing a fixed solution. Hand coding means writing individual statements in a programming language rather than using a preprogrammed routine. See hardwired, hand coding, generalized program and data independence.

Fixed vs. Variable Example
In the following pseudocode example, it takes half as many lines to hard code bouncing a ball 10 times rather than a variable number of times. See pseudocode.

Hard Coded (fixed number)

    start
  1    ballCount = 0
    loop
  2    bounce ball
  3    add 1 to ballCount
  4    if ballCount = 10
  5       stop
       else
  6    goto loop


   Generalized Code (variable number)

    start
  1    display "Enter Bounce Count"
  2    input to maxCount
  3    if maxCount not an integer
  4       display "Not a valid number."
  5       goto start
       else
  6       ballCount = 0
    loop
  7    if ballCount not = maxCount
  8       bounce ball
  9       add 1 to ballCount
 10       goto loop
 11    else
 12       stop
Copyright © 1981-2025 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
Mentioned in
References in periodicals archive
These technologies do not interpret data by themselves: they are tied either to deterministic, hard coded software programs created by humans or they are linked to a form of AI that can interpret human language into a form that algorithms can understand.
Domains are programs that provide a natural and fully conversational interface on specific topics, without requiring the users to memorize and use the specific phrasing of hard coded commands or skills.
The malicious code includes a hard coded Facebook page that receives an automatic 'like' from victims.
By comparison, existing digital assistants use hard coded programs built into them.
Flaws in Juniper's secure networking devices used by the US Defense Department and the FBI and vulnerabilities in Trend Micro's antivirus software, which were criticised last month by Google, serve as early examples of a trend for hidden backdoors being discovered, having been hard coded in vendor appliances.
His team did a large amount of software programming up front to allow them to design a system that was completely hard coded: it cannot do anything except what the individual sees.
Our advantage is that this practical mind-set is hard coded into children and young people; they intuitively solve problems with technology.
Over 40 percent leave sensitive information in the system log, and over 30 percent use hard coded credentials of some kind, it said.
"This simply shows a hard coded 60-30-10 isn't present but it does show voting tendencies for this election," he said.
Copyright © 2003-2025 Farlex, Inc Disclaimer
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional.