What is functional programming Flashcards

1
Q

Define functional programming

A

Style of programming in which baisc method of computation is the application of functions to arguments

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

what did FP bring along

A
new reasoning principles
new abstractions
new design patterns 
new algorithms
elegant code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Examples of FP commercial applications

A

Integrated circuit design (recursion)
natural language processors
robotic controllers

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

problems with programming languages

A

fundemental issue - many program languages were designed decades ago and havent significantly changed - designed for old architectures

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

What are imperative languages

A

algorithms are expressed by a sequence of commands

- high level ones express compurtations ina hardware independent way

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

What are side effects

A

large and complete software systems have side effects - those that occur in one subprogram can affect things other places. Can be brought about by variable assignment

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

Concurrency vs parallelism

A

conc - single cpu multitasking

parallelism - speed up via N computations in parallel

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

Functional concurrency

A

indirect references to immutable data structures

  • concurrency semanticcs for those references
  • automatic/enforced
  • no locks in user code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

why functional programming?

A

states are immutable
functions are pure and referentially transparent - can’t have side effects
recurion
first class citizens and higher order functions are used extensively

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

Benefits of functional programming

A

auto storage management
improves reability
enhances programmer productivity
facilitates code reuse

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

Software crisis - describe

A

bugs are common and widely accepted
putchasing new versions and pathces are also accepted
hardware is now cheaper
most softeare is still unreliable, unmanageable and unprovable

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

Computer science solutions to software crisis

A
Software engineering
now proof tecniques to prove correctness
parallel processing
automated SE
quantum computing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly