450 exam 1 Flashcards
reasons for studying this course
- increased ability to express ideas
- improved bg for choosing appropriate languages
- increased ability to learn new languages
- better understanding of significance of implementation
- better use of languages that are already known
- overall advancement of computing
four properties of programming languages
syntax, names, types, semantics
syntax
a precise description of a language’s grammatically correct programs
names
various kinds of entities in a program have names (e.g., variables, functions, parameters, classes, objects, etc.)
type
a collection of values and a collection of operations on those values
semantics
the meaning of a program
major programming domains
scientific, business, systems programming, AI, web software
language evaluation criteria (main)
simplicity and readability, orthogonality, clarity about binding, reliability, abstraction, support, cost
language evaluation criteria (other)
writability, portability, generality, well-definedness
simplicity and readability
small instruction set, simple syntax, ease of learning/programming
orthogonality
a relatively small set of primitive constructs can be combined in a relatively small number of ways to build the control and data structures; every combination is legal and meaningful
a lack of orthogonality leads to
exceptions to the rules of the language (and fewer exception rules = conceptual simplicity)
binding
the association between a variable and a property of that variable (e.g., a variable and its type or value)
early binding
takes place at compile time
late binding
takes place at run time
reliability
program behavior is the same under all conditions
with reliability, errors are ? and memory leaks are ?
detected and properly trapped; prevented
data abstraction
programmer-defined classes/types, class libraries
procedural abstraction
programmer-defined functions, standard function libraries
support
accessible (public domain) compilers/interpreters/IDEs, good texts and tutorials, wide community of users
cost
training programmers to use the language, writing/executing programs, maintaining programs (can be 2-4x as much as developing), reliability (poor reliability leads to high costs)
writabilty
how easily a language can be used to create programs
portability
the ease with which programs can be moved from one implementation to another
generality
the applicability to a wide range of applications
well-definedness
the completeness and precision of the language’s official definition
influence of the von Neumann architecture on the evolution of programming languages
- data and programs stored in MEMORY
- instructions and data are PIPED from MEMORY TO CPU
- basis for IMPERATIVE languages (variables ~ memory cells, assignment statements ~ piping, iteration/repetition is efficient)
influence of programming methodologies: 1950s and early 1960s
simple applications; worry about machine efficiency
influence of programming methodologies: late 1960s
people efficiency became important; readability, better control structures
influence of programming methodologies: late 1970s
data abstraction
influence of programming methodologies: middle 1980s
domain and data complexity; object-oriented programming
influence of programming methodologies: today
web and networked environment; parallel and distributed computing
four main programming paradigms
imperative, object-oriented, functional, and logic (declarative)
imperative programming languages
Fortran, Cobol, C, Ada, Perl
object-oriented programming languages
Smalltalk, Java, C++, C#, Python
functional programming languages
Lisp, Scheme, ML, Haskell
logic (declarative) programming languages
Prolog
imperative programming
the oldest; follows von Neumann model of computation
program and its variables are stored together in memory
imperative programming
program = a sequence of commands
imperative programming
state = values of all variables when program runs
imperative programming
essential building blocks of imperative programming
procedural abstraction, assignments, loops, sequences, conditional statements, etc.
object-oriented programming
a collection of objects that interact by passing messages that transform the state
sending messages, inheritance, polymorphism
object-oriented programming
functional programming
models a computation as a collection of mathematical functions