Programming Paradigms Flashcards
What are Programming Paradigms?
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
What is an Imperative Paradigm?
imperative programming paradigms use code that clearly specifies the actions to be performed
What is a Decelerative Paradigm?
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
Name types of Imperative programs
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
Name types of decelerative programs
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