1/8
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Definition of Programming Paradigm
A programming paradigm is a fundamental style of computer programming.
Examples:
object-oriented
imperative
functional
declarative
procedural
event-driven.
Definition of Procedural Programming Languages
The programmer specifies the method to be followed in order to solve the problem.
It is the lowest level paradigm since it mirrors hardware.
Examples: Basic, Pascal and C
Definition of Declarative Programming
• The programmer specifies the problem to be solved, but does not specify the method to arrive at the solution to the given problem.
• It is a programming paradigm that expresses the logic of a computation without describing its control flow.
• Many languages apply this style in attempt to minimise or eliminate the side effects by describing what the program should accomplish, rather than describing how to go about accomplishing it (the how is left up to the language implementation)
Definition of Imperative Programming Languages
Imperative programming is a programming paradigm that describes computation in terms of statements that change a program’s state.
• In much the same way that imperative mood in natural languages expresses commands to take action, imperative programs, define sequences of commands for the computer to perform the necessary computation.
• The term is used in opposition to declarative programming, which expresses what the program should accomplish without prescribing how to do it in terms of sequences of actions to be taken.
• Functional and logic programming are examples of a more declarative approach
Definition of Functional Programming
A program in a functional language consists of recursive mathematical equations, but do not support assignment or other state-changing statements.
• It treats computation as the evaluation of mathematical functions and avoids state and mutable data.
• It emphasises the application of functions, in contrast to the imperative programming style, which emphasises changes in state.
• Example: lisp, Miranda, ml
Definition of Event-Driven Programming Language:
Event-driven programming (EDP) is a programming paradigm in which the flow of the program is determined by events
• An application architecture technique based on two important sections; event selection (or event detection), and the second is event handling
• Written in any language, although the task is easier in languages that provide high-level abstractions.
• Some IDEs, such as Microsoft Visual Studio, provide code generation assistants that automate
the most repetitive tasks required for event handling
Example: sensor outputs or user actions (mouse clicks, key presses) or messages from other
programs or threads.
Definition of Object-Oriented Programming Languages
• Object-oriented programming (OOP) is a programming paradigm that represents concepts as "objects" that have data fields (attributes that describe the object) and associated procedures known as methods.
• Objects, which are usually instances of classes, are used to interact with one another to design applications and computer programs
A lot of languages belonging to other paradigms have been enhanced to include object-oriented
programming features. These include:
• Data abstraction
• Specifies object behaviour;
• Encapsulation
• Controls visibility of fields by providing access with public methods;
• Polymorphism
• Accommodates various implementations of an object’s behaviour;
• Inheritance
• Facilitates reuse of code through extension of a class from another that share common behaviour and
characteristics;
• Modularity
• Relates to a unit of compilation (loose coupling and high cohesion)
Define Step-Wise Refinement
Step-wise refinement is a way of developing a computer program by first describing general functions, then breaking each function down into details which are refined in successive steps until the whole program is fully defined.
• It is also called top-down design and is a divide and conquer algorithm