A Peer-reviewed Journal in Computer Science Professions Programming Paradigms
Programming paradigms |
---|
|
A programming paradigm is a cardinal manner of computer programming. There are four main paradigms: object-oriented, imperative, functional and declarative. [ane] Their foundations are distinct models of ciphering: Turing automobile for object-oriented and imperative programming, lambda calculus for functional programming, and starting time club logic for logic programming.
Overview
A programming model is an brainchild of a computer system. For example, the "von Neumann model" is a model used in traditional sequential computers. For parallel computing, there are many possible models typically reflecting unlike ways processors tin be interconnected. The most mutual are based on shared memory, distributed memory with message passing, or a hybrid of the two.
A programming language can support multiple paradigms. For example, programs written in C++ or Object Pascal tin be purely procedural, or purely object-oriented, or incorporate elements of both paradigms. Software designers and programmers make up one's mind how to use those paradigm elements.
In object-oriented programming, programmers can call up of a programme as a collection of interacting objects, while in functional programming a plan can be thought of every bit a sequence of stateless function evaluations. When programming computers or systems with many processors, process-oriented programming allows programmers to think about applications as sets of concurrent processes acting upon logically shared information structures.
Just as different groups in software engineering advocate different methodologies, different programming languages advocate different programming paradigms. Some languages are designed to back up 1 particular epitome (Smalltalk supports object-oriented programming, Haskell supports functional programming), while other programming languages support multiple paradigms (such equally Object Pascal, C++, Java, C#, Scala, Visual Basic, Mutual Lisp, Scheme, Perl, Python, Ruby, Oz and F#).
Many programming paradigms are as well known for what techniques they forbid every bit for what they enable. For case, pure functional programming disallows the utilise of side-effects, while structured programming disallows the utilize of the goto statement. Partly for this reason, new paradigms are oftentimes regarded as doctrinaire or overly rigid by those accustomed to earlier styles. [2] Avoiding certain techniques can go far easier to evidence theorems well-nigh a program'due south correctness—or simply to sympathize its behavior.
Multi-paradigm programming language
A multi-image programming language is a programming linguistic communication that supports more than than one programming epitome[ citation needed ]. As Leda designer Timothy Budd puts information technology: "The idea of a multiparadigm language is to provide a framework in which programmers tin can work in a variety of styles, freely intermixing constructs from different paradigms." The pattern goal of such languages is to allow programmers to use the all-time tool for a job, admitting that no one prototype solves all bug in the easiest or most efficient way.
One example is C#, which includes imperative and object-oriented paradigms as well every bit some support for functional programming through blazon inference, bearding functions and Language Integrated Query. Some other ones are F# and Scala, which provides similar functionality to C# just likewise includes full support for functional programming (including currying, pattern matching, algebraic information types, lazy evaluation, tail recursion, immutability, etc.). Perhaps the about extreme case is Oz, which has subsets that are logic (Oz descends from logic programming), a functional, an object-oriented, a dataflow concurrent, and other linguistic communication paradigms. Oz was designed over a ten-year period to combine in a harmonious way concepts that are traditionally associated with different programming paradigms. Lisp, while oft taught every bit a functional language, is known for its malleability and thus its ability to engulf many paradigms.
History
The lowest level programming paradigms are machine code, which directly represents the instructions (the contents of program memory) every bit a sequence of numbers, and assembly language where the car instructions are represented past mnemonics and memory addresses can be given symbolic labels. These are sometimes called kickoff- and 2nd-generation languages. In the 1960s assembly languages were developed to support library Copy and quite sophisticated conditional macro generation and pre-processing capabilities, Call to (subroutines), external variables and common sections (globals), enabling significant lawmaking re-utilize and isolation from hardware specifics via use of logical operators such as READ/WRITE/GET/PUT. Assembly was, and nonetheless is, used for fourth dimension critical systems and frequently in embedded systems every bit it gives the nigh straight control of what the machine really does.
The side by side accelerate was the development of procedural languages. These third-generation languages (the get-go described as high-level languages) use vocabulary related to the problem being solved. For example,
- C - developed c. 1970 at Bong Labs
- COBOL (Mutual Business Oriented Language) - uses terms similar file, move and copy.
- FORTRAN (FORmula TRANslation) - using mathematical language terminology, it was adult mainly for scientific and technology problems.
- ALGOL (ALGOrithmic Linguistic communication) - focused on being an appropriate language to define algorithms, while using mathematical language terminology and targeting scientific and technology problems just similar FORTRAN.
- PL/I (Programming Language One) - a hybrid commercial/scientific general purpose linguistic communication supporting pointers.
- Bones (Beginners All purpose Symbolic Instruction Code) - was developed to enable more people to write programs.
All these languages follow the procedural paradigm. That is, they describe, step by step, exactly the process that should, according to the particular developer at least, be followed to solve a specific problem. The efficacy and efficiency of any such solution are both therefore entirely subjective and highly dependent on that programmer's experience, inventiveness and ability.
After, object-oriented languages (like Simula, Smalltalk, C++, Eiffel and Java) were created. In these languages, data, and methods of manipulating the data, are kept equally a single unit called an object. The only way that a user can access the data is via the object's 'methods' (subroutines). Because of this, the internal workings of an object may be changed without affecting any code that uses the object. There is still some controversy by notable programmers such as Alexander Stepanov, Richard Stallman [3] and others, concerning the efficacy of the OOP prototype versus the procedural image. The necessity of every object to have associative methods leads some skeptics to associate OOP with software bloat. Polymorphism was developed equally 1 attempt to resolve this dilemma.
Since object-oriented programming is considered a image, not a language, it is possible to create even an object-oriented assembler language. Loftier Level Assembly (HLA) is an example of this that fully supports avant-garde information types and object-oriented assembly language programming - despite its early origins. Thus, differing programming paradigms tin be thought of every bit more than like 'motivational memes' of their advocates - rather than necessarily representing progress from one level to the adjacent. Precise comparisons of the efficacy of competing paradigms are frequently made more difficult considering of new and differing terminology applied to similar (but not identical) entities and processes together with numerous implementation distinctions across languages.
Within imperative programming, which is based on procedural languages, an culling to the calculator-centered hierarchy of structured programming is literate programming, which structures programs instead equally a human-centered web, as in a hypertext essay – documentation is integral to the program, and the program is structured post-obit the logic of prose exposition, rather than compiler convenience.
Independent of the imperative branch, declarative programming paradigms were developed. In these languages the computer is told what the trouble is, not how to solve the problem - the plan is structured as a collection of properties to detect in the expected result, not as a procedure to follow. Given a database or a set of rules, the computer tries to find a solution matching all the desired properties. The archetypical case of a declarative language is the fourth generation language SQL, besides every bit the family of functional languages and logic programming.
Functional programming is a subset of declarative programming. Programs written using this prototype employ functions, blocks of code intended to behave like mathematical functions. Functional languages discourage changes in the value of variables through assignment, making a corking deal of utilize of recursion instead.
The logic programming paradigm views ciphering as automated reasoning over a corpus of knowledge. Facts about the problem domain are expressed every bit logic formulae, and programs are executed by applying inference rules over them until an answer to the problem is institute, or the collection of formulae is proved inconsistent.
Run across besides
- Comparison of programming paradigms
- Type system
- Architecture description language
- Domain-specific language
- Mindset
- Modeling language
- Epitome
- Programming domain
- Turing abyss
References
- ^ Nørmark, Kurt. Overview of the 4 main programming paradigms. Aalborg University, 9 May 2011. Retrieved 22 September 2012.
- ^ Frank Rubin published a criticism of Dijkstra's letter of the alphabet in the March 1987 CACM where information technology appeared under the title 'GOTO Considered Harmful' Considered Harmful. Frank Rubin (March 1987). "'GOTO Considered Harmful' Considered Harmful" (PDF). Communications of the ACM 30 (3): 195–196. doi:x.1145/214748.315722. http://www.ecn.purdue.edu/ParaMount/papers/rubin87goto.pdf. [dead link]
- ^ "Way inheritance, cloning, hooks & OOP (Google Groups Word)". http://groups.google.com/group/comp.emacs.xemacs/browse_thread/thread/d0af257a2837640c/37f251537fafbb03?lnk=st&q=%22Richard+Stallman%22+oop&rnum=5&hl=en#37f251537fafbb03. [dead link]
External links
Programming language lists |
---|
|
- Classification of the chief programming paradigms
Links to related articles | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Source: http://kuliahkaryawan.widyakartika.ac.id/IT/en/3077-2963/Programming-paradigm_3684_kuliahkaryawan-widyakartika.html
Komentar
Posting Komentar