Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
3,907,315,945 visitors served.
forum Join the Word of the Day Mailing List For webmasters
?
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

computer programming

   Also found in: Dictionary/thesaurus, Wikipedia 0.01 sec.
computer programming [kəm′pyüd·ər ′prō‚gram·iŋ]
(computer science)

Computer programming

Designing and writing computer programs, or sequences of instructions to be executed by a computer. A computer is able to perform useful tasks only by executing computer programs. A programming language or a computer language is a specialized language for expressing the instructions in a computer program.

Problem solving

In this stage, the programmer gains a full understanding of the problem that the computer program under development is supposed to solve, and devises a step-by step procedure (an algorithm) that, when followed, will solve the problem. Such a procedure is then expressed in a fairly precise yet readily understandable notation such as pseudo code, which outlines the essentials of a computer program using English statements and programming language-like key words and structures. See Algorithm

A useful example concerns the problem of finding the greatest common divisor (gcd) of two given positive integers. After an analysis of the problem, a programmer may choose to solve the problem by the procedure described by the following pseudo code. (In the pseudo code, the modulus operator produces the remainder that results from the division of one integer by another; for example, 15 modulus 6 yields 3.)

  • 1.  Let x and y be the two given integers
  • 2.  As long an x and y are greater than 0, repeat lines 3–5
  • 3.  if x is greater than y
  • 4.  then replace x by the value of x modulus y
  • 5.  else replace y by the value of y modulus x
  • 6.  If x is 0
  • 7.  then y is the gcd
  • 8.  else x is the gcd

Lines 3–5 and 6–8 are examples of the selection control structure, which specifies alternative instructions and enables a computer to choose one alternative for execution and ignore the other. Lines 2–5 form a repetitive control structure (commonly called a loop), which causes the computer to execute certain instructions (lines 3–5) repeatedly.

Programmers indent to show the structural relationship among the statements and to enhance the readability of the program. In the example, indentation makes it clear that lines 4 and 5 are part of the selection structure beginning at line 3, that lines 3–5 are part of the loop that begins at line 2, and that lines 7 and 8 are part of the selection structure that begins at line 6.

An algorithm developed to solve a given problem should be verified to ensure that it will function correctly. The following list shows how the above procedure derives the gcd of 48 and 18 by successively modifying the values of x and y.

  • x y
  • 48 18 (Let x be equal to 48 and y equal to 18)
  • 48 18 (48 modulus 18 is 12, which replaces 48)
  • 12 18 (18 modulus 12 is 6, which replaces 18)
  • 12 6 (12 modulus 6 is 0, which replaces 12)
  • 0 6 (since x is 0, the loop ends and 6 is the gcd)
  • Implementation

    In this stage the pseudocode procedure developed in the problem-solving stage will be expressed in a programming language. There are numerous programming languages, in two broad classes: low-level languages, which are difficult for human programmers to understand and use but can be readily recognized by a physical computer; and high-level languages, which are easier for human programmers to use but cannot be directly recognized by a physical computer. Currently most computer programs are first written in a high-level language and then translated into an equivalent program in a low-level language so that a physical computer can recognize and obey the instructions in the program. The translator itself is usually a sophisticated computer program called a compiler. See Programming languages

    Shown below is the gcd-finding procedure written in a widely used high-level language called C++.

    The text beginning with/* and ending with */ (the first five lines above) is a program comment. Program comments are not executable instructions and do not affect the functioning of a computer program in any way, but are intended as a way to document a computer program. Appropriate program comments enhance program readability and are considered an important part of a computer program. A more readable program is usually easier to enhance or modify when such needs arise later. The rest of the above text is C++ code (instructions in the language C++) to compute the gcd of two given integers. Indentation in C++ code serves the same purpose as in pseudo code. It is obvious that the above C++ code closely parallels the pseudo code developed previously, as they both express the same abstract procedure.

    Object-oriented programming

    Object-oriented programming is a way to structure a computer program. The object-oriented paradigm has gained widespread acceptance and is supported by such widely used languages as C++ and Java. An object includes relevant data and operations on the data as a self-contained entity. Interaction with an object can be made by invoking the object's operations. Each object is an instance of an object class. Object classes may be related by inheritance; one class may be a subclass (specialization) of another class. At the center of an object-oriented program design is a collection of objects that represent entities in the application domain. Identifying the objects and object classes, the relationship among the object classes, and the interactions among the objects is a major issue in designing an object-oriented program. See Object-oriented programming

    Language processors

    Although many widely used programming languages are processed by compilation into machine-executable instructions, some programming languages (for example, LISP and Prolog) are usually interpreted instead of being compiled. When a computer program is interpreted, it is directly executed by another program called an interpreter without being translated into low-level, machine-executable instructions. Some other languages are processed by a hybrid approach. For example, a program in the language Java is first compiled into an equivalent program in an intermediate-level language, which is executed by an interpreter. See Computer, Digital computer



    Want to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit the webmaster's page for free fun content.
    ?Page tools
    Printer friendly
    Cite / link
    Feedback
    Mentioned in?  References in periodicals archive?   Encyclopedia browser?   Full browser?
    No references found
     
    Very often students of different academic level have trouble completing homeworks in computer programming and acquire computer programming help.
    Very often students of different academic level have trouble completing homeworks in computer programming and acquire computer programming help.
    Their task also includes coding user requests and specifications into a computer programming language.
     
     
    Computer Program Performance Specification
    Computer Program Problem Report
    Computer Program Product Baseline
    Computer Program Protection Manager
    Computer Program Steering Group
    Computer Program Tapes
    Computer Program Test
    Computer Program Test & Evaluation
    Computer Program Test Plan
    Computer Program Test Plan/Software Test Plan
    Computer Program Test Procedure
    Computer Program Test Procedure/Software Test Procedure
    Computer Program Test Procedures
    Computer Program Test Report/Software Test Report
    Computer Program Test Specification/Software Test Description
    Computer Program Test Specifications
    Computer Program/mer
    Computer programer
    Computer programer
    Computer programer
    computer programing
    computer programme
    computer programme
    computer programmer
    computer programmer
    computer programmer
    Computer Programmer Aptitude Battery
    Computer programmers
    Computer programmers
    Computer programmers
    computer programming
    Computer Programming & Testing Activity
    Computer Programming and Information Systems
    Computer Programming and Network Administration
    Computer Programming for Engineers
    Computer programming language
    Computer programming language
    Computer programming language
    Computer programming language
    Computer programs
    Computer programs
    Computer Programs & Systems, Inc.
    Computer Project Manager
    Computer Project On Technology
    Computer Prompting & Captioning Co.
    Computer Protection Program Manager
    Computer Protocol Heart Beat
    Computer Protocol Network Executive
    Computer punch card
    Computer punch card
    Computer Purchase Program
    Computer Random Numbering
    Computer Readability Editing System
    computer readable
    computer readable
    Computer Readable Form
    Computer readable format
    Computer Ready Electronic Files
    Computer Real Estate Technology
    Computer recycling
    Computer Recycling Center
     
    Encyclopedia
    ?

    Terms of Use | Privacy policy | Feedback | Advertise with Us | Copyright © 2012 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.