The University of Iowa
The College of Liberal Arts and Sciences
Department of Computer Science

Programming Languages and Tools:

CS:3210:0001

Lecture/Lab #1

Programming with C++

Intro; course organization; survey; language overview, tooling & basics

My background

  • MS Degree in Computer Science
  • Have been working with C++ for more than two decades
  • A [former] prominent open source contributor; at some point was among the top five contributors to Boost.org (est. 7,379 man/years of effort, $500M+ project valuation)

 (1998)

Course organization/format

  • Syllabus has been uploaded to ICON and Slack
  • Class format/protocols:
  • Lecture/lab: 10-15 minutes of new material followed by a hands-on assignment
  • Feel free to step out if needed, no need to ask for permission
  • Please raise your hand if you want to ask a question or ask for a clarification
  • Please introduce yourself when speaking
  • Do ask for clarification if you don't understand something
  • Please do engage in class discussions, class participation is part of the grade

or

Ask your question in the #questions channel

Course aspirations/promises

  • Detail: Every language construct presented in this course will be explained in sufficient detail to achieve real understanding (no "magic")
  • Utility: Only useful concepts, constructs, and techniques will be presented (the language is way too complex to cover everything that is technically possible)
  • Completeness: Presented concepts, constructs, and techniques can be used in combination to construct useful programs (although there are still many useful concepts, constructs, and techniques beyond what is taught here)
  • Realism: Presented concepts, constructs, and techniques can be used to build “industrial strength” programs (i.e. they have been used by others to do just that)
  • Simplicity: The examples used to illustrate the concepts, constructs, and techniques will be made as simple as possible (explicit markup will be provided for when the simplicity comes at the expense of realism)

Quick Survey

Language Overview

  • Started as an extension of C (was originally called "C with classes"), but is not a strict superset of C anymore
  • A general purpose, statically typed, complied programming language, with an emphasis on performance, efficiency and flexibility
  • A multi-paradigm language, with first-class support for imperative, object-oriented and generic programming
  • Formally defined by an ISO standard (the latest version ratified and published in December 2017)
  • Used to build search engines, browsers, games, trading systems, operating systems, graphics software, compilers, self-driving cars, desktop & mobile apps, Mars rovers, etc.

(that's 41 years ago!)

  • Available on virtually every type of computer hardware/architecture
  • C++ of 1979 is not the same as C++ of 2020

Statically Typed Language

What does that mean?

  • Each program entity has an associated type which determines a set of values together with a set of operations that can be performed on the entity.
  • Entity type is declared/can be deduced before the program is run.
  • The language enforces (most of) its type rules by diagnosing type errors before the program is run.
n = 42
n += 11
n = "Hi there"

Python

int n = 42;
n += 11;
n = "Hi there"; // error

C++

Compiled Language

What does that mean?

Translation of source code into an executable form is done as a step that is separate from program execution.

> python hello.py

Python

> clang++ hello.cpp -o hello.a
> ./hello.a

C++

Hello World

Made with Slides.com