6.102
6.102 — Software Construction
Spring 2023

Getting Started

6.102 requires you to get up to speed quickly. This page helps you set up your software development environment.

If you have any questions, or any trouble following the instructions below, please ask for help.

Install Node

Go to the Node.js Downloads page, and then:

  • for Windows or macOS: use the Windows or macOS installer

  • for Linux: click on “Installing Node.js via package manager” at the bottom of the page, and find the appropriate package for your Linux flavor

Make sure you install the LTS version of Node, version 18.x.y. Do not install the “Current” version, it’s a bleeding-edge development version that is not supported long-term.

  • If you already had an older version of Node installed, the installer will replace it with Node 18. If you need to keep an older version of Node installed because of some other project you work on, then please use nvm to manage multiple Node versions, so that you are using Node version 18 for this class.

If the installer asks questions during installation, you can accept the default choices and just click Next.

reading exercises

Your Node version

After installing Node, confirm the installation and version by opening a terminal or command prompt and running:

node --version

Enter your Node version below. It should take the form “x.y.z” for some numbers x, y, z.

(missing explanation)

Note that these questions don’t keep track of what you’ve previously entered. When you reload the page, all the questions reset themselves.

After the semester begins, if you’re a registered student, you will be able see your answers by looking at Omnivore.

Install TypeScript

After installing Node, open your terminal or command prompt, and run:

  • for macOS or Linux:

    sudo -H npm install -g typescript
  • for Windows:

    npm install -g typescript

reading exercises

Your TypeScript version

After installing TypeScript, confirm the installation and version by opening a terminal or command prompt and running the TypeScript compiler:

tsc --version

Enter your TypeScript version below. It should take the form “x.y.z” for some numbers x, y, z.

(missing explanation)

Install Visual Studio Code

Visual Studio code is an open-source programming editor that supports a wide variety of programming languages (not just TypeScript). You have to install it because 6.102 has several tools that are designed as extensions to Visual Studio Code (specifically Praxis Tutor and Constellation, installed later on this page). Although you are welcome to use a different editor for 6.102 work, you will need to have VS Code installed in order to use Praxis Tutor and Constellation.

Go to the Visual Studio Code download page, and download and install the appropriate installer for your platform.

  • If you would rather install VSCodium, that will work too.
  • If the installer asks questions during installation, you can accept the default choices and just click Next.

If you already have Visual Studio Code or VSCodium installed, you don’t need to reinstall it, just make sure it’s up to date by following the instructions below.

Make sure that you have the latest version installed. Run Visual Studio Code, and either:

  • macOS: CodeCheck for Updates…
  • Windows/Linux: HelpCheck for Updates…

It should either say “No updates available”, or help you update to the latest version.

reading exercises

Your VS Code version

Find out which version of Visual Studio Code you are running:

  • Windows/Linux: HelpAbout
  • macOS: CodeAbout Visual Studio Code
    • VSCodium on macOS: VSCodiumAbout VSCodium

The first line of the dialog box is the version number. It should take the form “x.y.z” for some numbers x, y, z. Enter it below.

(missing explanation)

Install Praxis Tutor

Praxis Tutor is 6.102’s tool for learning the syntax and semantics of TypeScript.

  1. Download the Praxis Tutor extension, which will save to your laptop as a file called praxis.vsix.

  2. Run Visual Studio Code, and go to View → Extensions.

  3. In the upper right corner of the Extensions pane that appears, click on ..., then Install from VSIX…, then find and install the praxis.vsix file you just downloaded.

  4. Close Visual Studio Code and restart it.

  5. From the menubar, choose View → Explorer. Then look at the bottom of the lefthand pane for the PRAXIS TUTOR heading. Click on that heading to make it visible. The Tutor pane may say something like “Not Found” or “Oops. The Tutor doesn’t know who you are” which means you still have to configure it using the next few steps.

  6. Open the Settings panel:

    • Windows/Linux: File → Preferences → Settings
    • macOS: Code → Settings… → Settings
      • if you installed VSCodium, look for VSCodium in the menubar, not Code.
      • in macOS versions 12 and earlier, look for Preferences in the first menu, not Settings
         
  7. Click here to get your personal start URL.

  8. In the box labeled Location: Personal Link, copy and paste your personal start URL.
    You should see the Praxis Tutor immediately reload and show a page with “Basic TypeScript” at the top, which means it’s ready for use.

  9. Close the Settings panel.

Install Constellation

Constellation is 6.102’s system for working on in-class programming exercises with a partner.

  1. Download the Constellation extension, constellation-vscode-0.4.7.vsix.

  2. In VS Code, go to View → Extensions, click on ..., then Install from VSIX…, and select constellation-vscode-0.4.7.vsix.

  3. Once again, close VS Code and restart it.

  4. Go to View → Command Palette, which brings up a search box that allows you to find and run any command in VS Code. Type “set up constellation” and select Set up Constellation.

    • If a window with “Do you want Code to open the external website” appears, click Configure Trusted Domains and Trust https://constellation.mit.edu.
    • Windows/Linux: if it fails with the error “certificate has expired,” open the VS Code Settings panel again and search for systemcertificates. Un-check the Http: System Certificates option, then restart VS Code and try again.
  5. Your web browser should open a Constellation page that requires MIT Touchstone login. Click the red Go! button.

  6. After following the prompts, you should see a “successfully authenticated and connected” notification in VS Code to confirm that Constellation is ready to use.

Install Git

You may already have Git installed. If so, you do not need to install the latest version.

  • Windows users should look for Git Bash.

  • macOS and Linux users should open the Terminal application and try running: git

If you don’t already have Git and need to install it: go to the Git project page and follow the link on the right side to download the installer for your platform. Follow the instructions in the README file in the downloaded .zip or .dmg.

Windows users should choose:

  • use Git from the Windows command prompt,
  • checkout Windows-style, commit UNIX-style line endings, and
  • add a shortcut to the Desktop

during the installation.

macOS: if you receive an “unidentified developer” warning, right-click the .pkg file, select Open, then click Open.

Set up Git and github.mit.edu

We will use Git from the command line, so make sure that’s where you are for this section, and whenever you use Git in this class:

  • on macOS and Linux, open the Terminal application.
  • on Windows, open Git Bash.
    • Don’t use the Windows Command Prompt, and don’t use Windows Subsystem for Linux.

Configure npm to use Git Bash (Windows only)

If you are using Windows, run the following command so that your npm command will be able to build problem sets:

npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"

If you are using macOS or Linux, do not run this command.

Set preferences

Before using Git, we’ll do some required setup and make it behave a little nicer.

  1. Who are you?

    Every Git commit includes the author’s name and e-mail. Make sure Git knows your name and email by running these two commands:

    git config --global user.name "Your Name"
    git config --global user.email username@mit.edu    # or any email address that reaches you

    You don’t necessarily have to use your MIT email address here; it just needs to be an email address that reaches you.

  2. Editing commit messages.

    Every Git commit has a descriptive message, called the commit message. By default, Git uses a popular but rather tricky editor called Vim to edit these messages. If you’ve never used Vim, we recommend that you use Visual Studio Code as your commit message editor instead.

    First make sure that your VS Code is configured to start from the command line, by running:

    code

    (or codium if you installed VS Codium instead of VS Code).

    Visual Studio Code or VSCodium should pop up. If you instead get an error message, run VS Code, configure it to launch from the command line, close and reopen your terminal, and try running code or codium again.

    Now configure git’s commit editor:

    git config --global core.editor "code --wait"
    • If you installed VS Codium, then use "codium --wait" in the command instead.
    • You are also welcome to stick with Vim if you already know how to use it, or to configure any other editor you’re more comfortable with.
  3. LOL.

    git log is a command for looking at the history of your repository.

    To create a special version of git log that summarizes the history of your repo, let’s create a git lol alias using the command (all on one line):

    git config --global alias.lol "log --graph --oneline --decorate --color --all"

    Now, in any repository you can use:

    git lol

    to see an ASCII-art graph of the commit history.

reading exercises

Git setup

To confirm that you set up Git properly, run

git config --list

Find the line that starts with alias.lol, and copy and paste just that line in the box below.

(missing explanation)

Connect to github.mit.edu

  1. Visit github.mit.edu and log in.

    Your problem set and project repositories for 6.102 will be stored on github.mit.edu.

  2. From the menu at the top right corner of the page, go to Settings, and select SSH and GPG keys.

  3. Follow the GitHub Enterprise instructions to set up SSH:

    1. Check if you already have SSH keys

    2. Generate a SSH key if you don’t have one

    3. Add the SSH key to your account – make sure you are working on github.mit.edu, not github.com

reading exercises

GitHub connection

To confirm that you set up your github.mit.edu connection properly, follow the instructions to test the SSH connection, where:

A successful connection will display a one-line welcome message and then exit. Copy and paste the one-line welcome message here:

(missing explanation)

Prepare for class

Authenticate to websites

We will use several websites in class, so it will save you time if you visit them now, using the web browser and laptop you will be using in class. You can get authentication out of the way, and cache some of the website in your browser, so that it will be much faster to open the site at classtime.

Please click on and authenticate yourself to each of these sites:

clicker.mit.edu is for short-answer questions during class. After you authenticate, you should see “6.102 Clicker” and a welcome message with your username.

quiz.mit.edu is the site we will use for in-class quizzes. After you authenticate, you should see “Pulsar / online quizzes”, and your username should be in the upper right corner.

caesar.mit.edu is the site we will use for code reviewing. After you authenticate, you should see a welcome message, and your username should be in the upper right corner.

Test Constellation

In class, we will do pair-programming exercises that require using Git to get the code, and Visual Studio Code and Constellation to edit it collaboratively with your partner.

Try out the workflow for starting a programming exercise now.

  • If you know somebody else in the class, please do this together.
  • If you don’t know anybody, just try it by yourself for now. You should be able to do everything up to the last step (connecting with a partner).

Go to the sample programming exercise and follow its directions to get the code, open it in VS Code, and prepare to start collaborating with Constellation.

Pause before the last step, and enter your joincode here.

reading exercises

Constellation joincode

Copy and paste your joincode here:

(missing explanation)

If you are doing this test solo, then you can stop after getting the joincode, and cancel the collaboration in Visual Studio Code. During class, you will be able to find a partner to work on the exercises.

If you are doing this test with somebody else, then enter each other’s joincodes as instructed. You should now be connected to each other. If you both open the same file (say, cumulative-avg.py) in VS Code, you should be able to see each other’s edits in real time. This is how you will work on the exercises during class. But for now, you don’t need to do anything more with this sample exercise. If you paired with a partner, you can disconnect by clicking Stop Collaborating at the bottom of VS Code window.