Make it Function: Chapter 5 of Overland

In many ways, functions are the basic unit of work in a c++ program.  Every program that we write will have at least one function – the main function.  From Chapter 5, you can skip (or skim) the following stuff:

  • Section 5.6 – Variable-length args.  These can be cool and useful at times, but don’t show up very much for us.
  • Section 5.7 – Lambdas.  Lambdas are awesome.  But, they can be confusing, so in this shortened class, we’ll probably bypass them.  Read them if you’d like.
  • Section 5.8 – constexpr functions.  Cool, but not immediately important for us.


In Java, the relationship between a function call and where the function is implemented (within a particular class) is nonexistent.   [Read more…]

Control Yourself: Chapter 4 of Overland

Control structures are at the core of programming.  As the name implies, they are the basic building blocks of controlling the computer.  By control structures, we typically include conditional constructs and looping or iteration constructs.  One plus here is that the control structures in C++ are nearly identical to the control structures in Java.

Section 4.1 contains a great Cheat Sheet related to control structures.  Of course, as you probably know from Java or other languages, some of the most popular are:

  • if
  • for
  • while

You’ll see that section 4.1 also lists the goto command.  Don’t ever use this.  It create “spaghetti” code.  Spaghetti is a yummy dinner option, not an appropriate adjective for code.

Section 4.7 covers Range-based For loops.  These are new to C++11.  So depending on exactly which version of the G++ compiler you may have running, they may or may not compile in your code.

Make sure you read through and understand the example Number Guessing Game in section 4.11.  Post questions to Piazza if you have any.

Peace, love, c++!

More c++ for u++: Chapter 2 and 3 of Overland

Some important take-aways from Overland: Chapter 2

  • Some of the c++ features that are covered in chapter 2 are part of the new C++ 11 standard.  Note that if you don’t have the most up-to-date compiler installed, some of the examples may not work on your computer.  If you’re having trouble, but not sure, slap a question on Piazza.
  • Read, but don’t obsess over, section 2.5.3.
  • Read, and obsess over, section 2.6.  Understanding the difference between single quoted characters and anything in double quotes will save you much pain and tears later.
  • Characters are stored as ascii codes, literally, integers.
  • Section 2.7, you can skip constexpr, extern, register, thread_local, and volatile modifiers.
  • Read, but don’t obsess over, section 2.9.

Some important take aways from Overland: Chapter 3

  • Just read it and enjoy it.

C++ Introduction

Intro to C++

C++ shares quite a few similarities with Java and other languages such as Python. It is a complex language with a very robust set of standard libraries.  But, we’ll start small and easy.

C++ is a general-purpose programming language emphasizing the design and use of type-rich, lightweight abstractions…C++ is a language for someone who takes the task of programming seriously.  Our civilization depends critically on software; it had better be quality software.” ~B. Stroustrup, Original Designer of C++, “The C++ Programming Language, Fourth Edition”, Addison- Wesley, 2013.

Important take aways from Overland: Chapter 1

I’ll use the same sample program that he introduces in section 1.1 to point out some important things in addition to Overland.

[Read more…]

Programming Concepts – Getting Started

Before Monday’s Class (6/2), please do the following:

  1. Set up your Development Environment
    • Make sure you’ve purchased your subscription to O’Reilly Safari.  See the Syllabus for more information.  You need to add the two books listed on the syllabus to your bookshelf on Safari.  They are:
      • Brian Overland. C++ for the Impatient. AddisonWesley Professional, 2013.
      • Ray Rischpater. Application Development with Qt Creator. Packt, 2013.
    • Read Preface & Chapter 1 of Rischpater. You can skip the sections on “Hello World using the Qt GUI Library” and “Hello World using Qt Quick”.
    • Download and install the Qt 5.2 or 5.3 SDK, Qt Creator, and associated software.  Follow the Rischpater book.
  2. Accept the invitation to Piazza.  Our link to the Piazza course is:  Bookmark it!
  3. Read Chapter 1 of the Overland text.
    1. Note that we’ll NOT be using Microsoft products for coding in this class.  The Overland text refers to Microsoft at times, and some of the coding stuff is particular to Visual Studio.  If you see Microsoft or Visual Studio, just skip it.
    2. In particular, you can skip section 1.2 and 1.3 of the book.
  4. Enjoy your weekend!