Skeleton (computer programming): Difference between revisions

Content deleted Content added
repaired link(s) to disambiguation pages (you can help) - Program, Psyche; mdy dates - no objection to changing to dmy if consistent
Monky2020 (talk | contribs)
Added two large sections of text, relation to pseudocode and class definitions. Part of the parallel programming section is included, will add more soon
Tags: nowiki added Visual edit
Line 39:
A '''class skeleton''' is an outline of a [[class (computer science)|class]] that is used in [[software engineering]]. It contains a description of the class's roles, and describes the purposes of the [[Variable (programming)|variables]] and [[method (computer science)|method]]s, but does not implement them. The class is later [[implementation|implemented]] from the skeleton.
 
== PseudocodeBackground ==
[[Software]] used in computers today<ref>{{Cite web|last=Lowery|first=Jeff|date=2019-11-02|title=Why is Software Development Difficult?|url=https://levelup.gitconnected.com/why-is-software-development-difficult-81a2a041d35e|access-date=2020-11-15|website=Medium|language=en}}</ref> is often complicated due to a host of reasons. This can mean that not just a single [[programmer]] can develop it, or that other modules or parts have to be separately imported. The programs can also be too complex on their own, some with multiple methods accessing a single [[Variable (computer science)|variable]] at the same time or even generating [[Pixel|pixels]] for displays. Skeleton code is used to assist programmers to develop their code with the least number of errors during the time of [[Compilation (computing)|compilation]].
 
Skeleton code is most commonly found in [[Parallel computing|parallel programming]], but is also applied in other situations, like [[documentation]] in [[Programming language|programming languages]]. This helps to simplify the core functionality of a potentially confusing method. It can also be used to allow for a small function within a larger program to operate without full functionality temporarily.
 
This method of programming is easier than writing a complete function, as these skeleton functions do not have to include main functionalities and can instead be hardcoded to use during development. They usually involve syntactically correct code to introduce the method, as well as comments to indicate the operation of the program. This is not always necessary to call a piece of text skeleton code.
 
== Relation to Pseudocode ==
[[Pseudocode]] is most commonly found when [[Plan|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.<ref name=":0">{{Cite journal|last=Bellamy|first=Rachel K. E.|date=1994-06-01|title=What Does Pseudo-Code Do? A Psychological Analysis of the use of Pseudo-Code by Experienced Programmers|url=https://www.tandfonline.com/doi/abs/10.1207/s15327051hci0902_3|journal=Human–Computer Interaction|volume=9|issue=2|pages=225–246|doi=10.1207/s15327051hci0902_3|issn=0737-0024}}</ref>
 
[[Programmer|Computer programmers]] are extremely dependent on pseudocode, so much so that it has a measurable impact on their [[Psyche (psychology)|psyche]].<ref name=":0" /> 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 editor|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.
 
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, but differs in the way that it is commonly written in an [[integrated development environment]], or [[Text editor|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==
{{Portal|Computer programming}}
* [[Template method pattern]]
 
== Implementation ==
Skeleton programming can be implemented in a range of different programming applications.
 
=== Programming language documentation ===
All, if not most programming languages have skeleton code used to assist in the definition of all built-in functions and [[Method (software engineering)|methods]]. This provides a simple means for newer programmers to understand the syntax and intended implementation of the written methods.
 
[[Java (programming language)|Java]], an [[Object-oriented programming|object oriented language]], focuses heavily on a structured documentation page with completely separated methods for each object part of Java’s packages<ref>{{Cite web|last=|first=|date=|title=Object (Java Platform SE 8 )|url=https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html|url-status=live|archive-url=|archive-date=|access-date=2020-10-02|website=docs.oracle.com}}</ref>. Each method is defined in the same format, with the name of the method as well as the syntax to be used in a [[Integrated development environment|IDE]] clearly visible at the top of a block. With Java’s focus on [[Scope (computer science)|scope]], [[data type]]<nowiki/>s and [[Inheritance (object-oriented programming)|inheritance]], this syntax is extremely useful for new, if not all programmers. This is followed by an in-depth explanation of the operation of the method, with errors below.
 
[[Python (programming language)|Python]] has a similar approach to document it’s in-built methods, however mimics the language’s lack of fixation on scope and data types <ref>{{Cite web|last=|first=|date=2009-02-14|title=Built-in Functions — Python v3.0.1 documentation|url=https://docs.python.org/3.0/library/functions.html|url-status=live|archive-url=|archive-date=|access-date=2020-10-03|website=docs.python.org}}</ref>. This documentation has the syntax of each method, along with a short description and an example of the typical use of the method or function. The skeleton code provided in the example gives programmers a good understanding of the function at a quick glance.
 
=== Class definition ===
[[Class (computer programming)|Classes]] written by third-party developers, primarily as a part of libraries, also showcase their programming in the form of skeleton code. This helps to inform any that are new to the library as to how the functions and methods operate. [[P5.js|P5.Js]] uses this format on their documentation page to explain the intended use of certain included functions<ref>{{Cite web|title=reference {{!}} p5.js|url=https://p5js.org/reference/#/p5/alpha|access-date=2020-11-15|website=p5js.org}}</ref>. This is different to the programming language documentation however, using skeleton code to display [[Parameter (computer programming)|parameters]] rather than all possible uses of the method.
 
With programming languages being developed and written primarily in english, people speaking other languages find it hard to develop new software. [[Natural-language user interface|Natural Language Interfaces]] (NLIs) have been used in some studies <ref>{{Cite journal|last=Özcan|first=E.|date=2004|title=GENERATING JAVA CLASS SKELETON USING A NATURAL LANGUAGE INTERFACE|url=http://dx.doi.org/10.5220/0002683301260134|journal=Proceedings of the 1st International Workshop on Natural Language Understanding and Cognitive Science|publisher=SciTePress - Science and and Technology Publications|volume=1|pages=126 - 134|doi=10.5220/0002683301260134|isbn=972-8865-05-8|via=}}</ref> to assist people in these situations. The study showed classes written in Java through the use of NLIs. This removed the need for learning syntactical rules, however meant that the class was written using a basic set of skeleton code.
 
=== Parallel programming ===
[[Parallel computing|Parallel programming]] is the operation of multiple functions simultaneously most commonly used to increase efficiency. These are typically the hardest types of programs to develop, due to their complexity and interconnectedness with the [[Computer hardware|hardware]] in question as well. Many developers have attempted to write programs with this core functionality<ref name=":1">{{Cite journal|last=González-Vélez|first=Horacio|last2=Leyton|first2=Mario|date=2010-11-01|title=A survey of algorithmic skeleton frameworks: high-level structured parallel programming enablers|url=http://dx.doi.org/10.1002/spe.1026|journal=Software: Practice and Experience|volume=40|issue=12|pages=1135–1160|doi=10.1002/spe.1026|issn=0038-0644|via=}}</ref>, however this has been met by varied results.
 
[[Algorithmic skeleton]] frameworks are used in parallel programming to abstractly describe the methods in question for later development. The frameworks are not limited to a single type, and each of these types have different purposes to increase the efficiency of the developer’s program. These can be categorised into three main types: [[Data parallelism|data-parallel]], [[Task parallelism|task-parallel]] and resolution<ref name=":1" />.
 
==== Data-Parallel ====
These skeleton algorithms are used to develop programs that work on large data based software, usually identifying the connections between data for later use. Data parallel algorithms include ‘maps’, ‘forks’ and ‘reduces’ or ‘scans’.
 
‘Maps’ are the most commonly used data parallel algorithms, and typically involve a single operation completed on a large set of data. To increase efficiency, a number of data sets have this operation applied to them simultaneously, before the data is structured together again at the end.
 
‘Forks’ are similar to ‘maps’ but they use a different operation for certain data types. This is known as multiple data parallelism<ref name=":1" />.
 
‘Reduces’ or ‘scans’ are used to apply prefixes to a set of data, before then applying an operation upon the data. These are different to ‘maps’ as they have a set of partial results during the runtime of the method itself. {{Portal|Computer programming}}
==References==
{{Reflist}}
 
{{DEFAULTSORT:Skeleton (Computer Science)}}
<!--Categories-->
[[Category:Computer programming]]
[[Category:Programming language topics]]
 
 
{{Prog-lang-stub}}