Chapter 1 (Paradigm) Flashcards

1
Q

Types of paradignms

A

Imperative
Object-oriented
Functional
Logic (declarative)

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

What is imperative paradigm?

A

uses a sequence of statements to determine how to reach a certain goal.

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

Examples of imperative languages?

A

Cobol, fortran, c, ada, perl

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

What is object-oriented (OO) paradigm?

A

An oo program is a collection of objects that interact by passing messages that transform the state.

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

Examples of oo languages?

A

Smalltalk, Java, c#, c++, python

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

What is a functional paradigm?

A

Functional programming models a computation as a collection of mathematical functions.
Input = domain
Output = range
Functional languages are characterized by functional composition, recursion.

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

Examples of functional languages?

A

Lisp, Scheme, ML, Haskell

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

What is a logic paradigm?

A

Logic programming declares what outcome the program should accomplished

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

When studying logic programming what do we encounter?

A

Programs as sets of constraints on a problem
Programs that achieve all possible solutions
Programs that are non deterministic
Prolog

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

What are the levels of abstraction in computing?

A
Natural language,
Application area,
Programming language
Compiler/interpreter
User interface (IDE)
Operating system
Machine language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What makes a successful language?

A
Simplicity and readability
Clarity about binding
Reliability
Support
Abstraction
Efficient implementation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is binding?

A

It is the association between an object and a property of that object

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

Some examples of binding?

A

A variable and its type

A variable and its value

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

What is an early binding?

A

Early binding takes place at compile-time

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

What is a late binding?

A

Late binding takes place at run time

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

When is language reliable?

A

Portable, goes on many platforms,
Type errors are detected
Semantic errors are properly trapped
Memory leaks are prevented

17
Q

What is orthogonality?

A

A language is orthogonal if its features are built upon a small, mutually independent set of primitive operations.

18
Q

What is an efficient implementation?

A

Embedded systems
Web applications
Corporate database applications
AI applications

19
Q

What is the difference between compiler and an interpreter?

A

Compiler - produces machine code

Interpreter - executes instructions on a vm.

20
Q

Some examples of compiled languages?
Some examples of interpreted languages?
A bit of both?

A
Compiled languages:
- Fortran, Cobol, C, C++
Interpreted languages
- Scheme, Haskell, Python
Hybrid
- JVM