Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 1 Introduction of Programming Paradigms - Coggle Diagram
Chapter 1 Introduction of Programming Paradigms
reasons to study
-increase capacity to express ideas
-improved background for choosing appropriate language
-increase ability to learn new languages
-better use of language that are already known
-overall advancement of computing
Categories of abstraction
Data abstraction
-abstract property of data such as character string which is the subject of computation control
Control abstraction
-abstract property of the transfer of control
-example: loop, procedure
Level of abstraction
-basic abstraction
-structured abstraction
-unit abstraction
Object Oriented Programming
key features:
-abstraction
-inheritance
-encapsulation
-polymorphism
Language
Language definition
-refer to the structure of the language
-it is like grammar of a natural language
language translation
-must have a translator that accept other programs written in the language in question and that either execute them directly or transform them to a form suitable for execution
language design:
1.readability
2.abstraction -natural expression of the structure of data
-control abstraction
3.complexity
-building abstraction that hide details when appropriate
-establish conventional interface
-establishing new language when describing a design
key concept
-computation
-machines readability
-human readability
Programming paradigms
-a paradigmatic style of programming
-to support multiple paradigms
-a model for a class of programming languages that share a set of common characteristic and its difference.
Function paradigm
-definition of functions
-describing computation come for math
Logic paradigm
-based on symbolic logic
-bring the style of mathematical logic to computer programming
example: PROLOG
Scripting paradigm
-acts upon some system in an external or independent manner and can be removed or disabled without disabling the system itself
Complication process
-that is possible to have translator that are intermediate between interpreter and compiler:
Translation process
-both compiler and interpreter must perform a similar operations when translating a source program
-a language translator must also maintain:
-runtime environment
-preprocessor
Basic abstraction
-refer to collection of localized machine information
-example: the data value given name and is called data type
Structured abstraction
-collecting related data values into a single unit
Unit abstraction
-collect information about entire pieces of program
-similar to abstract data type concept
-abstract data type : 1.stack 2.queue 3.list
imperative paradigms
a programming language is called imperative language if it has the following properties:
1.the sequential execution of instruction
2.the use of variables representing the memory locations.
3.the use of assignment to change the values of variables.
Interpreter
-a translator that executes a program directly
-one step process
-view as simulator
compiler
-a translator that produce an equivalent program from suitable for execution
interpreter VS compilation
-interpreter less overhead and less compilation steps
-interpreter translate the program line by line
compilation
-need efficient execution
-scan the entire program
-language use C++