1/112
Final Exam Explained
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Reasons for studying concepts of programming languages (5 Reasons)
Better Understanding, Increase Computational idea capacity, Ability to learn languages, Compare Two languages for better use in situation, significance of implementation
Readability
How easy a programming language is to read, ie syntax
Writability
Measure of ease to write solutions
Reliability
Degree to which programs perform without errors
Cost
Time for development, time, or resources used
Simplicity
How very easily understandable and basic a language is. Impacts writability and readability
Orthogonality
These symbols mean exactly what they mean and there is a lack of extra conditions. Real life example is changing the TV channel which doesn’t change the volume or anything else
Non-Orthogonality
Allows for another thing to happen when writing the code. Real life example is something like a helicopter changing direction as speed increases
Von Neumann
The architecture that is most commonly used
Imperative
data oriented programming language. Think the language C.
Object Oriented Programming
Object focused languages like C++
Interpreted
Doesn’t turn into binary to execute or just not compiled. Example is Javascript
Hybrid
High level to intermediate language which combines compiled and interpreted. Example is Java or C#
Compiled
Language will go through a compiler before executing. Example is C++
Static
Compile time legaility checking
Dynamic
Run time legality checking
Compiled VS Interpreted VS Hybrid
Compiled - Faster to execute, slower to write
Interpreted - Slower to execute, Faster to write
Hybrid - Very average between the other two
Syntax
Form that dictates how a language is written
Semantics
Meanings of what has been written from the language
Lexemes
Characters
Tokens
Sets of characters
Lexical Analysis
Valid characters being used check
From Lexical Analysis to Tokens
Symbols that the language can understand
Tokens to Syntactic Analysis
Valid statements being written
From Syntactic analysis to Compute
Has to check for valid data to compute the syntax
BNF Stands for
Backus Naur Form and is the Natural notation for describing syntax
Parse Tree
Used based on the BNF grammar rules.
If given someyhing like assign, expression, term, fact, id. order would as written. ID is usually created using two “ marks
Precedence
PEMDAS in Math or a vertical movement
Associativity
Which to do based off of rules on the same horizontal level. Such as Multiply or Divide on the same level
Ambiguity
More than 1 parse tree can be created from the expression
Attribute
Left Side
Predicate
Right side of grammar
Names
String of characters used to identify an entity in a program
Reserved Word
A special word that cannot be used as a name
Address of Variable
memory location
Type of variable
classification
Binding of Variable
value association
Scope of variable
range of statements where variable is visible
Lifetime of variable
time bound to a memory location
Name of a variable
in code identifier
Data type
types that have predefined logical operations
Pointer
refers to an address within memory
References
refers to an object or value within memory
Gabrage Collection
frees up no longer used memory
Dangling pointers
pointers that point to a memory location that is not valid
Side Effects
function alters memory locations outside of the scope
Widening
Upcast like int → Float
Narrowing
Downcast like double → float
Coercion
process of converting one type of data type to another
Imperative Programs
2 forms of control statements
Selecting among alternatives = if else
Repeating Selected Statements = for & while loops
One Way
Selects between 2 actions based on a single condition. If statement
Two way statement
If- Else
Multi-way statement
Switch, n-many if, case, elif
Examples
Iterative Statement - For Loop
Condition Controlled Loops - While
Count Controlled Loops = For Loop
Iteration based on data structure
iterator similar to a python for loop
Communicating Sequential Processes
Interactions between concurrent processes. IE multithreading
Guarded Commands
Basis for communicating sequential processes for a non-deterministic program
Fundamentals of Subprograms
Only load as they come into memory
One single entry
Control retunred to caller at termination
Subprogram
Self contained part of code that can be called anywhere within the program
Call
explicit request for execution
Active
subprogram is in execution
Header
type and parameter profile
Body
executable logic
Formal Parameters
Defined in header
Actual Parameters
values passing in
Positional Parameters
Refers the actual to the formal parameters
Keyword Paraemeters
name of formal used to map to actual parameters. Think of an alias
Default Parameters
default values passed if nothing is sent in
Design Issues for Subprograms
1) Can they be overloaded?
2) What parameter passing methods are used?
3) Static or dynamic local variables?
Activation Record
organization of variables in addition to implementation of lifetime and scope of the variables in a table like set up
Run Time Stack
All stack frames at the current postion
Environment Pointer
Holds beginning of current activation recordD
Dynamic Link
link to location where called
Static Chain
start of each activation record
Static Depth
Integer that hold the value of each scope level
Nesting Depth
Difference of current scope depth and the depth of the variable access
Offset
Beginning of Activation Record to beginning of storage point
Deep Access
references to non local variables through dynamic links
Shallow Access
alternative way of implementing dynamic scope
Abstraction
Combining of logical operations
Process Abstractions
Hiding details of thread execution
Abstract Data Type
Data type’s behavior is from the user
Encapsulation
building data and methods into a single unit
Information Hiding
keeping information from the users
Required Features of OOP Languages and Definitions
Objects = Procedures and Data
instantiation = Creating an object from a class
Inheritance = making new classes by changing existing ones
Polymorphism = use of one symbol to represent many types
Single Inheritance
derived class rom a single base class
Multiple Inheritance
class derives from multiple parent classes
Generalization
subclass into a superclass
Specialization
Creates more specific classes from higher
Parent/Child
Class relationship where child inherits from parent class
Pure Object Oriented Language
Needs:
Small Talk
Everything as an object
Has encapsulation
Exception Handling and Event Driven similarities
Involved reading to specific occurrences within a system
Triggered by something happening
Decoupling Mechanisms
Design Issues for Exception Handling
Identify and categorize exceptions
Checked or unchecked exceptions
Granularity of exceptions
Creating without harming code readability
Functional Programming Languages
LISP, Haskell
Pure Functions to build and edit software
Math Functions
all functions are seen as deterministic math functions
Fundamentals of Functional Programming Languages
uses pure functions
recursions
cant modify variables
Basics of primitives
built in functions that operate on numbers, symbols, and lists
Basics of lists,numbers, and symbols
All fundamental data types
Doman and Range
X-Axis
Y-Axis
Referential Transparency
replaces properties without changing program’s behavior