00 history Flashcards

(34 cards)

1
Q

programming paradigm

A

the way you structure code based on the what you are programming

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

types of programming paradigms

A

imperative, structured, procedural, object-oriented, functional, event-drive, declarative, automata-based

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

imperative paradigm

A

step by step instructions that the computer follows, most basic form

direct assignments, common data structures, global variables

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

example of imperative paradigm

A

fortran, c, java, python

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

structured paradigm

A

style of imperative with more readable/reusable code, bans goto and enforces function/block

structograms, indentation

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

example of structured paradigm

A

c, java, python

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

difference between imperative and structured

A

imperative -> loops, conditionals
structured -> functions, blocks

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

procedural paradigm

A

reusable how to -> functions
helper functions and main logic

multiple small functions

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

example of procedural

A

python

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

is procedural a type of structured which is a type of imperative

A

yes

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

object oriented paradigm

A

data -> objects that change through predefined methods only

encapsulation, polymorphism, inheritance

related to procedural

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

example of object oriented

A

java -> classes
using getter methods to modify class objects in main

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

functional

A

declarative -> what instead of how
filters data, immutable: data flows through the pipeline

related to declarative

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

example of functional

A

erlang, elixir

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

event driven

A

code executes in response to events
(mouse clicks, timer interrupts)

related to procedural and dataflow

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

example of event driven

A

javascript, GUI button, main loop, event handlers, asynch processes (timer)

17
Q

declarative

A

defines program logic but not control flow -> specify WHAT not HOW

18
Q

example of declarative

19
Q

automata based

A

programs -> model systems as state machines

related to event drive and imperative

20
Q

example of automata

A

network protocols

21
Q

fortran

A

formula translator

22
Q

cobol

A

common business oriented language

23
Q

LISP

A

List processing

first functional PL

24
Q

BASIC

A

beginners all-purpose symbolic instruction code

interactive shell user interaction -> for non stem students

25
spaghetti code
no clear structure --> code that is hard to read and understand if you follow code, it resembles spaghetti
26
example of spaghetti code
deeply nested conditionals, assembly, fortran
27
what programming was a direct response to the issue of spaghetti code?
structured programming
28
how did this program help prevent spaghetti code?
code executes line by line if else/switch for branching instead of goto iteration -> for/while loops single in single out: functions have one clear start and end
29
structured program theorem
all computable functions can be computed with 3 single in and out control flow structures: 1. sequence (statements executed in order) 2. selection (if/else for branching) 3. iteration (while/for for loops)
30
4 pillars of why OO
encapsulation polymorphism inheritance abstraction
31
polymorphism
access objects of different types through same interface each type has own implementation of interface methods -> static: lets you have methods with same name and different parameters -> determines which one to call based on parameters dynamic: subclass overrides superclass method -> method overriding
32
encapsulation
makes attributes and methods work as class while protecting attributes *car -> car runs, and user uses steering wheel, brake, gas etc without knowing how the car works
33
inheritance
allows there to be class hierarchy -> classes can extend other classes and inherit those methods -> parent child classes
34
abstraction
hiding complex implementation details and showing essential parts of object to simplify user interaction