Software: VS Code, C++ compiler, & command line reference

Two programming environments

We will program in a two environments this semester:

  • locally on your computer (using Visual Studio Code to edit code and the g++ compiler—doesn't require an internet connection, what you would use in the real world, and gives you experience with the command line (also allows real-time collaboration)
    • you'll need to know how to get around the command line to compile and run code (see below)
  • in the zyBook—required to submit Challenge Activities and zyLabs

Aside from the zyBook, all the software required for this course and associated online accounts are free. Instructions for how to install and use the requisite software is below.

C++ compiler (g++)

Visual Studio Code editor

  • Install the Visual Studio Code text editor (here's a video going over VS Code—click "Show more" in the description for a table of contents)
  • Install the "C++ Intellisense VS Code" plugin:
    1. click on the plugins icon on the left of any VS Code window
    2. find "C++ Intellisense" in the list of recommended plugins"
    3. click "Install"
      • installing c++ Intellisense
  • Install the "Live Share Extension Pack" code plugin (similar steps to above, but search for "Live Share Extension Pack")
    • this will allow you to share a VS Code window with others and collaboratively edit/run code in real time; you can also chat over audio
    • see this video (note that "VS Live Share" has been renamed "Live Share")
    • you need a (free) Microsoft or GitHub account

Formatting your code

You should become familiar with proper code formatting conventions concerning indentation and spacing; see this page. If you find you are having trouble, you may use the autoformatter, which you can run by pressing Shift+Alt+F (Windows) or Shift+Option+F (macOS)—here's a video example.

Using the command line

Since we will compile and run C++ program from a command line, it's important that you know a few basic command line commands to help you navigate through it. It will seem pretty foreign at first, but as you practice with it, it'll become second nature in just a few weeks. Visual Studio Code has a built in command line that you can access by going to "View" -> "Terminal".

Putting it all together: write, compile, and run a simple program