PLC Final

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/86

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

87 Terms

1
New cards

Excdeptions

catch things that are truly exceptional (can’t proceed with future statements in block if exception occurs)

2
New cards

Error

caught synchronously, can recover

3
New cards

approach to exceptions

caught should go from more specific to general

4
New cards

resumption model

resume execution right after exception was thrown

5
New cards

termination model

resume execution after the block where the exception handler was found (what modern langs use)

6
New cards

should exceptions be used

cause overhead - error detection is less expensive

7
New cards

checked expections

checked at compile time, to check if you handle the exception

8
New cards

unchecked exceptions

not checked at compile time (runtimeException, divide by 0, index out of bounds)

9
New cards

type inference

determine type based on value or expression

10
New cards

static typing

determined and checked at compile time

reduce amount of code to be compiled

programming errors caught early

improve security and reliability

11
New cards

Dynamic typing

determined at runtime

flexibility

less efficient

12
New cards

strong typing

type is checked at compile time or before operation

prevents unsafe operations

13
New cards

weak

any type can be used and an attempt to use it will occur

14
New cards

type compatibility

allows you to swap certain types for others (int for float)

15
New cards

implicit conversiona

when there isn’t enough room to store full representation

16
New cards

explicit conversion

occur with casts or methods in language

17
New cards

data type definition

set of values

18
New cards

different ways to check if two types are equal

structure - same objects, structure, or properties

include names?

19
New cards

enums

types that are more readable and restricted to a certain range of vals

20
New cards

union

allows you to choose which type at runtime, reduce memory requirements

21
New cards

arrays in C

on stack

specifiy size

22
New cards

arrays in java

on heap,

get the size with length prop

23
New cards

pointer vs reference types

c pointers you can use in an expression and manipulate

java you cant perform operation on actual reference

24
New cards

logical programming what is it

write statements of what is true and what can lead to something being true

25
New cards

logical constants

names or numbers (atoms)

26
New cards

logical predicates

names that return true or false, can accept args

27
New cards

logical functions

returns something other than true or false

28
New cards

logical variables

can hold a val like other langs, but determined by logic and reasoning

29
New cards

issues with logical programming

define what solution is, not how to solve it

ordering is very important

not proven to be true, then its false

limited applications

30
New cards

prolog fact

csds.

31
New cards

prolog predicate

major(cs)

32
New cards

prolog language is compiled or code and interpreted

language(X) :- compiled(X).
language(X) :- code(X), interpreted(X).

33
New cards

prolog method recursion format

method(X,Y,R) :- method(X+Y+R)

34
New cards

side effect

values change in a function

35
New cards

referential transparency

a value of what a function returns only depends on the value of its arguments

36
New cards

functional programming compontents

no side effects

referential transparency

functions are treated as data

easier to perform parallel execution

37
New cards

vars in functional

stand for values, should not change

38
New cards

state in functional

no notion of state

values of function depend on values of arguments

should not care about internals of functions

loose coupling

easier testing

39
New cards

control in functional

no loops, if is a function

40
New cards

functional, composition

takes two functions as params and returns a function

41
New cards

higher order function

function has function param or returns a function

42
New cards

functional benefits

predictible

easy to test

easy to understand

43
New cards

downside of functional

copying a lot

less efficient

less intuitive

44
New cards

key functional ideas

all functions have clear inputs

no assignments

no loops

function only depends on value of params, not outside values

functions are first class data values

45
New cards

haskell print

putStr $ “hello” ++ show x

46
New cards

haskell input

putStr ““

input ← getLine

let x = read input :: type

47
New cards

haskell function

name param1 param2 param3 = if param then blah else blah

48
New cards

haskell guards

name param

| param >= 30 = “blah”

|

| otherwise = “blah”

49
New cards

update list haskell

let updated list = list ++ [x]

50
New cards

print list haskell

print (x:xs) = do

putStrLn $ “hi: “ ++x

print xs

print [] = return ()

51
New cards

binding times

definition of lang

implementation of language

compilation

linking

loading

execution

52
New cards

extern keyword

global variables to be defined across files

53
New cards

symbol table

names and binding, in binding type and (scope)

54
New cards

static scoping

primarily used

determined at compile time

block defines scope

structure of language defines scope

55
New cards

dynamic scoping

not really used

determined at runtime

56
New cards

when dues c vs java use symbol table

compile time | both

57
New cards

activation

local vars are allocated at runtime when block is reached

memory used for each block is activation record

58
New cards

OOP main idea

mimic real world object

59
New cards

primary OOP goals

promote code reuse

promote modifiability with less code

promote independence of software

60
New cards

code reuse oop

redenfinition

overriding

abstraction

polymorphism

inheritance

interfaces

61
New cards

C++

dynamic binding is optional

support multiple inheritance

62
New cards

Kotlin vars

var name: String

var y = 3

63
New cards

kotlin input

print(“HI $varIfNeeded”)

val entered = readLine()

64
New cards

let kotlin

length?.let{

}

65
New cards

kotlin function

fun name(param:type) : return type? {

}

66
New cards

kotlin list

val todos = mutableListOf(““, ““)

todo.add(““)

67
New cards

kotlin interface testable

interface Testable {

fun takeQuiz()

}

class Student: Testable{

override fun takeQuiz(){

}

}

68
New cards

kotlin class

open class Plant (var x:type) {

open fun function(){

}

}

class Tree : Plant

constructor (donor:type) : super (x)

69
New cards

kotlin regex

Regex(““)

results = regex.matchEntire(x)

70
New cards

kotlin reader and writer

val reader = BufferedReader(FileReader(““))

val writer = BufferedWriter(FileWriter(““))

71
New cards

c input

char buffer[32]

printf(“Enter”)

char * x = fgets(buffer, 32, stdin)

72
New cards

c string copy

strcpy(destination, source)

73
New cards

c struct

typedef struct name {

char x

int years;

} name

74
New cards

scanning

convert sequence of character to tokens

75
New cards

parser

processes tokens and focuses on syntax structure

76
New cards

Go

google

concurrency

imperative/OOP

77
New cards

Lua

simple

space time effient

oop

no concurrency

78
New cards

R

stats

functional and OOP

79
New cards

Cobol

old

processes records, payroll, accounting

readable

imperative

like assembly

80
New cards

Crystal

oop

good performance

readable

faster than python

81
New cards

Rust

memory safety without garbage collection

functional and oop

hard to learn

takes a while to compile

82
New cards

C#

similiar to java

c style

desk and mobile apps

83
New cards

Julia

for research

clean syntax

math friendly

easy parallelism

84
New cards

Clojure

functional

for concurrency

85
New cards

Velato

music

no parallelism

86
New cards

Lean

proofs

functional

87
New cards

Lua

procedural

people needed their own language

good for games, apps, embedded systems