Chapter 1 (Paradigm) Flashcards
Types of paradignms
Imperative
Object-oriented
Functional
Logic (declarative)
What is imperative paradigm?
uses a sequence of statements to determine how to reach a certain goal.
Examples of imperative languages?
Cobol, fortran, c, ada, perl
What is object-oriented (OO) paradigm?
An oo program is a collection of objects that interact by passing messages that transform the state.
Examples of oo languages?
Smalltalk, Java, c#, c++, python
What is a functional paradigm?
Functional programming models a computation as a collection of mathematical functions.
Input = domain
Output = range
Functional languages are characterized by functional composition, recursion.
Examples of functional languages?
Lisp, Scheme, ML, Haskell
What is a logic paradigm?
Logic programming declares what outcome the program should accomplished
When studying logic programming what do we encounter?
Programs as sets of constraints on a problem
Programs that achieve all possible solutions
Programs that are non deterministic
Prolog
What are the levels of abstraction in computing?
Natural language, Application area, Programming language Compiler/interpreter User interface (IDE) Operating system Machine language
What makes a successful language?
Simplicity and readability Clarity about binding Reliability Support Abstraction Efficient implementation
What is binding?
It is the association between an object and a property of that object
Some examples of binding?
A variable and its type
A variable and its value
What is an early binding?
Early binding takes place at compile-time
What is a late binding?
Late binding takes place at run time
When is language reliable?
Portable, goes on many platforms,
Type errors are detected
Semantic errors are properly trapped
Memory leaks are prevented
What is orthogonality?
A language is orthogonal if its features are built upon a small, mutually independent set of primitive operations.
What is an efficient implementation?
Embedded systems
Web applications
Corporate database applications
AI applications
What is the difference between compiler and an interpreter?
Compiler - produces machine code
Interpreter - executes instructions on a vm.
Some examples of compiled languages?
Some examples of interpreted languages?
A bit of both?
Compiled languages: - Fortran, Cobol, C, C++ Interpreted languages - Scheme, Haskell, Python Hybrid - JVM