Kludge - in Computer Science

In Computer Science

In modern computing terminology, a kludge (or often a "hack") is a solution to a problem, doing a task, or fixing a system that is inefficient, inelegant, or even unfathomable, but which nevertheless (more or less) works. To kludge around something is to avoid a bug or some difficult condition by building a kludge, perhaps relying on properties of the bug itself to assure proper operation. It is somewhat similar in spirit to a workaround, only without the grace. A kludge is often used to change the behavior of a system after it is finished, without having to make fundamental changes. Sometimes the kludge is introduced in order to keep backwards compatibility, but often it is simply introduced because the kludge is an easier alternative. That something was often originally a crock, which is why it must now be hacked to make it work. Note that a hack might be a kludge, but that 'hack' could be, at least in computing, ironic praise, for a quick fix solution to a frustrating problem.

A kludge is often used to fix an unanticipated problem in an earlier kludge; this is essentially a kind of cruft.

Something might be a kludge if it fails in corner cases, but this is a less common sense as such situations are not expected to come up in typical usage. More commonly, a kludge is a poorly working heuristic which was expected to work well. An intimate knowledge of the context (i.e., problem domain and/or the kludge's execution environment) is typically required to build a corner case kludge. As a consequence, they are sometimes ironically praised.

An anecdotal example of a kludge involved a computer part supposedly manufactured in the Soviet Union during the 1960s. The part needed slightly delayed receipt of a signal to work. Rather than setting up a timing system, the kludge was to make the internal wires extra-long, increasing the distance and thus increasing the time the electrical signal took to reach its destination.

A variation on this use of kludge is evasion of an unknown problem or bug in a computer program. Rather than continue to struggle to find out exactly what is causing the bug and how to fix it, the programmer may hack the problem by the simple kludge of writing new code which compensates. For example, if a variable keeps ending up doubled in a certain code area, add code which divides by two when it is used, after the original code has been executed.

In computer networking, use of NAT (Network Address Translation) (RFC 1918) or PAT (Port Address Translation) to cope with the shortage of IPv4 addresses is an example of a kludge. Another common example are quickstarts like those shipped with OpenOffice.org, RealPlayer, QuickTime and Adobe products, in which a bloated program that normally takes a long time to load is kept in memory to reduce the delay in starting it.

In FidoNet terminology, the term "kludge" refers to a piece of control data embedded inside a message.

Read more about this topic:  Kludge

Famous quotes containing the words computer and/or science:

    What, then, is the basic difference between today’s computer and an intelligent being? It is that the computer can be made to see but not to perceive. What matters here is not that the computer is without consciousness but that thus far it is incapable of the spontaneous grasp of pattern—a capacity essential to perception and intelligence.
    Rudolf Arnheim (b. 1904)

    Our civilization is shifting from science and technology to rhetoric and litigation.
    Mason Cooley (b. 1927)