C C T B H P N

Lecture #2 - Survey of C++ Language

Getting started with language models, classes, and templates

Web Resources:

CppCon - 2014, Going Native 2013
Herb Sutter's Blog, Herb Sutter on C++11, Herb Sutter keynote - Going Native 2012
Scott Meyer's Blog, S.M. on thread suspension, S.M.: C++11 Sampler
Stroustrup's Home Page
Code Project, Boost Library
Excellent C++ Q&A, Excellent reference - CppReference.com, CPlusPlus.com, C++ TechLinks

Content:

This lecture provides some help with Project #1, then surveys the C++ Language.
  1. Readings for Lecture #2 Text: chapter 1
    Project #1
    C vs. C++, C++ Classes, Templates, C++11
    Compilation, Computation, and Memory models, ppt
    C++ Survival Guide, doc
  2. Glossary of Terms
    • Scope:
      Any set of code statements enclosed in braces "{" and "}". Scopes come in two forms:
      Function scopes and all the control scopes they contain are executable scopes.
      Namespace, class, struct, and enum scopes are declaration scopes.
    • Stack Frame:
      Memory temporarily allocated from the program's stack to an executable scope.
      Allocation occurs when the program's thread of execution enters that scope.
      The stack frame holds a function's parameters and return value and any local data declared in that scope.
      This allocation becomes invalid when the thread of execution leaves it's scope.
  3. Syllabus
    Describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects.
  4. Help Session:
    The Instructor's Friday morning Help Session will normally start at 9:00 am in CST 4-201.
  5. Getting free copy of Visual Studio 2017 from MSDN. from DreamSpark.
    You may alternately download and install the free Visual Studio 2017 Community Edition.
  6. Problem with Dependencies
    Motivation for a lot of what we do in this course.
  7. Background - Programming Languages, by Type

    • Imperative:
      Language statements describe computer activities.
      Examples: Assembly language, C, C++, Java, C#
    • Object Oriented:
      Language uses classes and class relationships to structure programs.
      A subclass of imperative languages.
      Examples: C++, Java, C#, JavaScript as of ECMA6
    • Functional:
      Language statements define functions and execute them.
      Functions have no side effects.
      Functions are first class objects - they can be passed and returned from other functions.
      Data may be immutable.
      Examples: Haskell, Lisp, parts of JavaScript, small parts of C++, i.e., lambdas, template-meta programming
    • Declarative:
      Language statements declare the desired results, often in terms of conditions.
      Sometimes constructed as a theory of formal logic, with computations as deductions in that logic.
      Examples:
      SQL - extracts data from a database
      Regular Expressions - detect strings that match a specification
      Prolog - evaluates predicates about relationships.
      make - builds program components based on declarations of code relationships.
      C++ - some of the STL algorithms have a declarative "flavor".
  8. Survey of C++ Language
    Note: Our college server will not serve vsdx files. If you click on a vsdx link you will get a "404 : not found" message. I use those links when showing lecture pages from my laptop.
  9. Project Helper code - Project1HelpS2019
  10. basic C++ code demos
    Shows how to implement and use simple classes, derived classes, and templatized classes.
  11. first look at STL notes, pptx
    The Standard Template Library (STL) provides a set of useful containers, iterators, and algorithms. You can use the containers without knowing too much about how templates work. We will get to that soon.
  12. basic STL code demos
    Shows how easy it is to use vectors, lists, sets, and maps.
  13. Visual Studio IDE:
  14. Review Syllabus, Review Getting Started
  15. Software Design

CST strip