Programming environments
Two programming environments
We will program in two environments this semester: on you computer and in the zyBook. The former requires that you install the Visual Studio Code text editor and a C++ compiler, and instructions for how to do this are below. The zyBook environment loads directly in your browser, so you only need to have an up-to-date web browser and an internet connection to use it.
Why have two?
While the zyBook interface is convenient both for quick programming and for the purposes of me administering assignments, it is limiting in a number of ways. First, you must be connected to the internet to use it, which is not always the case when you're programming. Second, it doesn't allow you to use graphics or support common requirements such as reading from/writing to files and command line arguments. Third, it is not a "real" environment; you would not use something like zyBooks if you were to write a program outside of this class.
So, we will use zyBooks when these limitations are not an issue, and the Visual Studio Code/C++ compiler environment otherwise.
Getting setup
- Install the Visual Studio Code plain text editor
- auto-format code with Shift+Alt+F (Windows) or Shift+Option+F (macOS)
- if that doesn't work, make sure you install the C++ Intellisense VS Code plugin by clikcking on the plugins icon on the left of any VS Code window (1. in the screenshot below), find "C++ Intellisense" in the list of recommended plugins" (2. in the screenshot), and click "Install" (3. in the screenshot)
- Installing a C++ compiler and developing C++ programs
- video guides
- written guides
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". You can also use the Terminal application on macOS, or GitBash/PowerShell/ConEmu on Windows.
- Command line basics
- video guides
- written guides
- The command line interface (one of my pages)
- other resources