hard code

(redirected from Hard coding)
Also found in: Wikipedia.

hard code

[′härd ′kōd]
(computer science)
Program statements that are written into the computer program itself, in contrast to external tables and files to hold values and parameters used by the program.

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 a program that bounces a ball 10 times rather than a variable number of times:

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
References in periodicals archive ?
With a single tag and no hard coding, FirstImpression.io creates and monetizes highly tailored display, video, and native ad products across all devices.
MatsSoft's low-code software platform enables rapid delivery of enterprise-grade business applications with a minimum of hard coding and upfront investments.
"With Blackboard Extractor, there was an unbelievable amount of hard coding. Every time we moved from one term to the next, editing was required.
* Avoid Hard Coding Configuration and Timing Values
* Reduce and eliminate hard coding of business logic--too many processes use business logic that is hard coded deep inside numerous systems.
No hard coding --the system is fully client-configurable 'out of the box'.
That includes the data flow that starts at prescheduling, charge master management (hard coding), charge/order reconciliation, HIM processes (soft coding, grouping and abstracting of data), the billing processes (and any prebill audit processes), and review of remittance data and reconciliation up until final payment.
"In the past, home automation had been a lot like programming in MS-DOS," says Mark Morgan, vice president of sales for Control 4, referring to Microsoft's old programming language that required doing hard coding, as opposed to programming via drag and drop with a graphical interface.