Alan Freedman -- The Computer Language Company - Computer Desktop Encyclopedia
Computer Desktop Encyclopedia
Longest-Running Tech Reference on the Planet

A CDE Definition

You'll love The Computer Desktop Encyclopedia (CDE) for Tech Term of the Day (TTOD)


hard coded

Programming code that solves a problem, but offers little flexibility for future modifications. Hard coding could be thought of as "brute force" programming: it gets the job done. However, the degree to which a program is hard coded determines how difficult it is to change with each new type of data that is introduced or each new function that is added.

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

Hard Coding Vs. Hand Coding
While hard coding and "hand coding" sound somewhat similar, they are not. Hard coding refers to writing a fixed solution rather than a generalized one. Hand coding refers to writing the program in a programming language rather than a high-level GUI-based tool. See hardwired, hand coding, generalized program and data independence.

Fixed Vs. Variable Example
In the following very simple pseudocode example, it takes half as many lines of code to write a program that bounces a ball 10 times (fixed task) rather than a variable number of times:

   Hard Coded (10 times)

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

   Flexible Code (variable number)

  1    display "Enter Bounce Count"
  2    input to maxCount
  3    if maxCount not an integer
  4       display "Not a valid number."
  5       goto start
  6       ballCount = 0
  7    if ballCount not = maxCount
  8       bounce ball
  9       add 1 to ballCount
 10       goto loop
 11    else
 12       stop

Personal Use Only

Before/After Your Search Term
Hangouts on Airhard copy
happy facehard core
haptichard disc
haptic gaminghard disc drive
haptic hologramhard disk
haptic interfacehard disk array
haptic VRhard disk configuration
hapticshard disk defect management
hard boothard disk drive
hard bouncehard disk interfaces

Terms By Topic
Click any of the following categories for a list of fundamental terms.
Computer Words You Gotta KnowSystem design
Job categoriesUnix/Linux
Interesting stuffPersonal computers
InternetIndustrial Automation/Process Control
Communications & networkingAssociations/Standards organizations
HistoryDesktop publishing
ProgrammingHealthcare IT
System design