Jump to content

Skeleton (computer programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Monky2020 (talk | contribs) at 08:34, 9 October 2020 (Added section on relation to pseudocode. Includes a reference plus a number of wikilinks). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Skeleton programming is a style of computer programming based on simple high-level program structures and so called pseudo code. Program skeletons resemble pseudocode, but allow parsing, compilation and testing of the code. Dummy code is inserted in a program skeleton to simulate processing and avoid compilation error messages. It may involve empty function declarations, or functions that return a correct result only for a simple test case where the expected response of the code is known.

Skeleton programming facilitates a top-down design approach, where a partially functional system with complete high-level structures is designed and coded, and this system is then progressively expanded to fulfill the requirements of the project. Program skeletons are also sometimes used for high-level descriptions of algorithms. A program skeleton may also be utilized as a template that reflects syntax and structures commonly used in a wide class of problems.

Skeleton programs are utilized in the template method design pattern used in object-oriented programming. In object-oriented programming, dummy code corresponds to an abstract method, a method stub or a mock object. In the Java remote method invocation (Java RMI) nomenclature, a stub communicates on the client-side with a skeleton on the server-side.[1]

A class skeleton is an outline of a class that is used in software engineering. It contains a description of the class's roles, and describes the purposes of the variables and methods, but does not implement them. The class is later implemented from the skeleton.

Pseudocode

Pseudocode is most commonly found when developing the structure of a new piece of software. It is a plain english portrayal of a particular function within a larger system, or can even be a representation of a whole program. Pseudocode is similar to skeleton programming, however deviates in the fact that pseudocode is primarily an informal method of programming[2].

Computer programmers are extremely dependent on pseudocode, so much so that it has a measurable impact on their psyche[2]. This method of program design is also most often done on pen and paper, further moving the text from what is actually to be implemented. Skeleton programming mimics this, however differs in the way that it is commonly written in an integrated development environment, or text editors. This assists the further development of the program after the initial design stage. Skeleton programs also allow for simplistic functions to operate, if run.

See also

References

  1. ^ Freeman, Eric; Freeman, Elisabeth; Kathy, Sierra; Bert, Bates (2004). Hendrickson, Mike; Loukides, Mike (eds.). "Head First Design Patterns" (paperback). 1. O'REILLY: 440. ISBN 978-0-596-00712-6. Retrieved 2012-08-28. {{cite journal}}: Cite journal requires |journal= (help)
  2. ^ a b Bellamy, Rachel K. E. (1994-06-01). "What Does Pseudo-Code Do? A Psychological Analysis of the use of Pseudo-Code by Experienced Programmers". Human–Computer Interaction. 9 (2): 225–246. doi:10.1207/s15327051hci0902_3. ISSN 0737-0024.