Programming Paradigms Flashcards

1
Q

What are Programming Paradigms?

A

different approaches to using programming language to solve a problem

split into two broad cargeories - imperative and declerative

can be broken down into more specific paradigms.

imperative programming paradigms inclides procedural + object-orientated paradigms (OOP)

declerative paradigms split into logic and functional paradigms.

paradigm use deoends on type of problem that needs solving

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an Imperative Paradigm?

A

imperative programming paradigms use code that clearly specifies the actions to be performed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Decelerative Paradigm?

A

focuses on stating desired result rather than exact series of instructions need to be performed to get result

it’s the role of the programming language to determine how best ot obtain result and details on how its done is abstracted from the user

common in expert systems and AI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name types of Imperative programs

A

procedural - applied to a wide range of problems and is relatively easy to write and interpret
type of imperative programming which uses sequence of instrucctions which may be contained within procedures
instructions are carried in a step-by-step manner

examples - Pascal, Python, Logo

Object-Oriented: applicable to certain types of problmes with lots of reuseable components which have similar characteristics.
OOP is built on entities called objects formed from classes which have certain attributes and methods
focuses on making programs that are reusable easy to update and maintain

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name types of decelerative programs

A

functional programming - uses concept of reusing set of function, which form core of the program
programs are made up of line of code consisting of function calls, oftten combined within each other.
closelt linked to mathematics

examples: Haskell, C#, Java

Logic languages - use code which defines a set facts and rules based on the problem
queries are used to find answers to problems

example : Prolog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly