Thursday, February 9, 2017

Entry 4 - Programming Paradigms

Programming Paradigms

Definitions:
“A programming paradigm is a style or a ‘way’ of programming.”
Major paradigms include:
Imperative: commands result directly in control flow
Imperative programs show the exact operations, and control flow is programmed exactly Structured: programs are developed with nested loops and if then statements to orchestrate command flow
The structured paradigm is a subset of imperative. It uses nesting of loops and conditionals and does not include use of a goto
Object Oriented: languages like java are object oriented, and as such they operate by sending messages to objects which have a state and behavior
Object oriented languages allow programmers to use a series of objects with local memory and set of operations
Declarative: programs state desired output, not how to achieve it
This kind of programming states results, and the interpreter figures out how to get to the desired end result.
Functional: functional programming calls functions instead of assigning variables to accomplish control flow
This means that in loops and conditionals, the control expression doesn’t include variables. Rather it includes a single or a series of functions that are being called in order to decide whether or not to run a piece of code.
(Many other paradigms exist, from object oriented to reflective)

Relation to computing:

A paradigm is a style of programming. Some languages lend themselves more towards one paradigm than others and some languages support paradigms that others do not. Programming paradigms are not mutually exclusive. This means that a particular piece of code can take advantage of multiple paradigms at the same time, and that the presence of one style does not imply a lack of other styles. Paradigms show the variety of programming languages in what they support and how they are designed, and they also allow programmers to decide what styles they wish to take advantage of among those supported by the programming language they are using.

Sources: 
Toal, Ray. "Programming Paradigms." Computer Science. Loyola Marymount University,            2015. Web. 9 Feb. 2017.

No comments:

Post a Comment