Content deleted Content added
Stevebroshar (talk | contribs) →See also: alphabetize |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1:
{{Short description|
{{More citations needed|date=June 2022}}
'''Modular programming''' is a [[software development]] mindset that emphasizes
A module [[Interface (computing)|interface]] expresses the elements that are provided and required by the module. The elements defined in the interface are detectable by other modules. The [[implementation]] contains the working code that corresponds to the elements declared in the interface. Modular programming is closely related to [[structured programming]] and [[object-oriented programming]], all having the same goal of facilitating construction of large software programs and systems by [[Decomposition (computer science)|decomposition]] into smaller pieces, and all originating around the 1960s. While the historic use of these terms has been inconsistent, ''modular programming'' now refers to the [[High-level programming language|high-level]] decomposition of the code of a whole program into pieces: ''structured programming'' to the [[Low-level programming language|low-level]] code use of structured [[control flow]], and ''object-oriented programming'' to the ''data'' use of [[Object (computer science)|objects]], a kind of [[data structure]].
Line 28:
In the Java programming language, the term "package" is used for the analog of modules in the JLS;<ref>James Gosling, Bill Joy, Guy Steele, Gilad Bracha, ''The Java Language Specification, Third Edition'', {{ISBN|0-321-24678-0}}, 2005. In the Introduction, it is stated "Chapter 7 describes the structure of a program, which is organized into packages similar to the modules of Modula." The word "module" has no special meaning in Java.</ref> — see [[Java package]]. "[[Java Module System|Modules]]", a kind of set of packages, were introduced in [[Java 9]] as part of [http://openjdk.java.net/projects/jigsaw/ Project Jigsaw]; these were earlier called "superpackages" were planned for Java 7.
Conspicuous examples of languages that lack support for modules are [[C (programming language)|C]] and have been [[C++]] and Pascal in their original form, [[C (programming language)|C]] and [[C++]] do, however, allow separate compilation and declarative interfaces to be specified using [[header file]]s. Modules were added to Objective-C in [[iOS 7]] (2013); to C++ with [[C++20]],<ref>{{cite web|url=https://isocpp.org/files/papers/n4720.pdf|title=N4720: Working Draft, Extensions to C++ for Modules}}</ref> and Pascal was superseded by [[Modula]] and [[Oberon (programming language)|Oberon]], which included modules from the start, and various derivatives that included modules. [[JavaScript]] has had native modules since [[ECMAScript]] 2015. [[
Modular programming can be performed even where the programming language lacks explicit syntactic features to support named modules, like, for example, in C. This is done by using existing language features, together with, for example, [[coding conventions]], [[programming idioms]] and the physical code structure. [[IBM i]] also uses modules when programming in the [[Integrated Language Environment]] (ILE).
|