CSC 533: Programming Languages
Spring 2024

Midterm Review


Tue, Feb 27
  • The test will be in-person, via Blueline.
  • You must bring a laptop to class (or use one of the lab machines).
  • It will be graded out of 100 points, but there will be 104 points available. So, you can miss 4 points and still be perfect!
Types of questions
  • factual knowledge: TRUE/FALSE, multiple choice
  • conceptual understanding: short answer, discussion
  • synthesis and application: explain/trace/modify code, simulate stack/heap management, ...

    There is a practice mini-test in Blueline with sample questions. It does not count towards your class grade.
Study advice
  • review online lecture notes
  • review the text book (if not mentioned in class, won't be on test)
  • look over quizzes, homework assignments
  • reference other sources for examples, different perspectives
  • Take the practice mini-test!
Course material Overview and History programming paradigms: imperative vs. declarative machine language--> assembly language--> high-level languages language translation: compiled vs. interpreted evaluation criteria: readability, writability, reliability key languages: FORTRAN, LISP, ALGOL, C, C++, Java review of Java, object-oriented programming Syntax and Semantics syntax BNF (EBNF) grammar, derivation, parse tree, ambiguity building precedence & associativity into grammar rules operational semantics Variables and Bindings static vs. dynamic binding variable attributes name: keyword vs. reserved word, naming conventions type: static (explicit or implicit) vs. dynamic binding type checking, coercion address: static vs. stack-dynamic vs. heap-dynamic (implicit or explicit) value: l-value vs. r-value scope & lifetime: static vs. dynamic scoping Data Types primitive data types integer, floating-point (decimal, fixed-point, rational, ...) boolean, character pointer can be used for indirect addressing, dynamic memory management dangling reference, garbage reference heap management: can allocate/deallocate in arbitrary order allocate/deallocate from free (linked) list memory reclamation: reference counts, garbage collection Partition & Copy vs. Mark & Sweep & Compactify Data and Control complex data types string, enumeration, subrange array subscript types, subscript ranges, multi-dimensional allocation (static vs. fixed stack-dynamic vs. stack-dynamic vs. heap-dynamic) record/struct/class field access, accessibility, variant record/union assignments & expressions control structures counter- vs. logic-controlled loops branching Subprograms subprogram linkage (call & return sequences) parameters positional vs. keyword, default values in mode (by-value) vs. out mode (by-result) vs. inout mode (by-value-result, by-reference, by-name) implementing subprograms activation record, run-time stack static vs. dynamic links Language Evolution C design goals: high-level abstractions, support for systems programming features: functions, natural control statements, pointers, by-value parameters memory mgmt: stack-dynamic by default, malloc & free C++ design goals: support OOP but retain C performance, gentle path to OOP features: classes, inheritance, convenience/reliability features, by-value & by-reference memory mgmt: stack-dynamic by default, new & delete Java design goals: modern & (relatively) clean OOP language, high performance but portable features: full OOP support w/ dynamic method binding, removed bad stuff, by-value memory mgmt: stack-dynamic primitives, heap-dynamic objects, automatic garbage collection