hard coded

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)

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


   Flexible 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 ?
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.
Fear is hard coded into our neural circuitry through the amygdala, a small, almond-shaped nuclei of neurons within the medial temporal lobe of the brain.
Topics discussed include simple hard coded AI, finite state machines, rule-based systems, random and probabilistic systems, planning AI development, emergent behavior, and emotive AI.
asp), providing an automated solution to help UK firms quickly locate and adjust value added tax (VAT) rates that are hard coded in complex, tax related spreadsheets.
CSPM is the first and only commercial solution that addresses the issue of hard coded passwords in applications that reside on unattended servers.
map), thus decoupling the object from being hard coded to the database.
He further added "that most companies offering rapid automated solutions do not consider many technical aspects of the Year 2000 remediation process such as addressing sorts and indexes in programs, handling Year 2000 as a leap year, hard coded `19's' in the program, and already partially Year 2000 compliant systems.
4mm square u-chip contains a 128 bit unique identification code that is hard coded into read only memory (ROM) during chip manufacture.
Accommodating for changes in the business environment requires uncovering and redefining hard coded logic across all applications.
Leading IT research firm Gartner contends, "Being simultaneously rule-driven and agile is difficult under the traditional hard coded approach to automating rules(1)," and recommends that organizations seeking agility develop a strategy for explicit support of business rules, such as automating rules and policies with a business rule engine.