Lab 1: Class Setup

This lab is to get all of the administrator things out of the way so that everyone is up and ready to start in this class and ready to code.

Class Resources

This webpage

The course website is the central location of all of our communications and information about our class. This website contains the following:

  • Syllabus
  • Lecture Slides
  • Assignment Info
  • Lab Info
  • Project Info
  • Other resources

Please bookmark or other wise save this site for your references

Bcourses

Our BCourses site usage will be limited in this class to

  1. Assignment Submission
  2. Easy setup for Piazza
  3. Zoom and REcording info

For all assignments, labs, and the project, you will need to go to BCourses to submit your work. For Labs, you will just need to write the world “Completed” in the text area. For assignments and the project you will paste the URL of your git repository (more on that next week)

Piazza

Our Piazza instance is our general email distribution list system where everyone can answer each other questions (usually faster than the instructors can).

Please note: please send ALL correspondence through Piazza. You can send a private note to the instructors through Piazza. This is needed because I’m not the fastest responder to email, but will respond to Piazza more quickly.

GitHub

Today we will get everyone set up for GitHub. We will explain more later, but in short GitHub is a web service that provides git repositories to be shared. A git repository is a repository of files whose history is tracked and recorded by the version control system Git. We will talk more about this next week.

We have a GitHub organization where all of your code will be hosted for assignments and the project. Please note: you will not need to upload your labs to GitHub.

Initial setup instructions

  • Please log into BCourses and ensure you have access to the class.
  • Please click on the Piazza navigation link in BCourses to set up your Piazza account automatically. You should see Piazza load within BCourses
  • Please send both me and our TA your GitHub username through Zoom chat as a private message. If you do not have a GitHub account, please create one at this link. We will add you to the GitHub Organization for this course.
  • Please wait for an email from GitHub saying you are a part of the organization

Technologies used in class

Programming language

We are primarily going to use Python 3 in this class. Python is an interpreted programming language that is used in web applications, backend services, and even data science. Its versatility makes it extremely flexible and powerful in a number of environments. If you would like to read more about Python’s flexibility check this article.

Terminal

When learning about backend services, you will need to interface with an application called “the Terminal”, or “Command Prompt” and so on. What this back box with white letters is is a text only interface that interacts with your computer. You can delete and create files, edit files, run applications, and so on. Getting familiar with navigating your computer in this way is pivotal to be able to build backend services. Mac users can use the “terminal” application that is already installed on your computer.

However, for Windows users: we will be using unix commands. This will mean that you will need to find some way to run unix commands on your computer.

Also note: for a quick walkthrough of the common commands on the terminal please take a look at this article. Even though it’s written for Ubuntu, the same principles apply for Mac/Windows

Text Editor / IDE (Integrated Development Environment)

The vast majority of programming languages are written in plain text. Plain text is exactly as it sounds: files that contain only text. For example, if you see a file that has a “.txt” extension at the end (e.g. readme.txt) then that is a plain text file. However if you saved a file in Microsoft Word (and it has a “.doc” or “.docx” extension) then that is not a plain text file: Microsoft Word contains the text and other information (like formatting and line spacing) in the file itself.

So what we want to have is an editor that edits plain text and can give us some features that make coding easier. A text editor is usually lightweight and focuses on editing text, syntax highlighting, and possibly autocompletion for the language you are writing in.

Examples of solid text editors for coding are (all should work for Mac/Windows/Linux)

An IDE goes beyond text editing to add features to help you write code easier (e.g. running your code in the editor itself, debugging code). Some are specific to the programming language that you are writing in. Since we are working primarily in Python, here are some IDE’s that we recommend:

For this class I will use and recommend Visual Studio Code for it’s relative lightweight profile and it’s ability to be used for a variety of programming languages.

Coding setup instructions

For this lab we want to install and setup our IDE, Programming language, and terminal so that we can start coding next week.

Please install the following:

  • IDE: Visual Studio Code (or your favorite Text Editor IDE for Python)
    • Mac users: if you get a popup saying you cannot run Visual Studio Code, go to System Preferences -> Security and at the bottom you should see a message saying that Mac OS blocked Visual Studio Code from opening. If you click Open Anyway, and then Open, you should be good to go
  • Terminal: Mac users can use the terminal app
    • Windows users: please install the windows subsystem (instructions here) you can have a real linux system where you can run unix commands
      • I would suggest installing Ubuntu as your linux distribution, but truthfully it should all work the same
  • Python 3

To test if you have completed this lab

If you can do the following, you have completed this lab:

  1. Open Visual Studio Code (or other IDE)
  2. Create a file named “hello_world.py” on your Desktop
  3. Type the code: “print(“Hello world”)” and save it to the file
  4. Open your terminal
  5. Change your directory to your Desktop (hint: the command is “cd”)
  6. Run the following: “python3 hello_world.py”

If you see the words “Hello World” in hyper, you are done!

Submission

If you have completed these steps and you have received that email from GitHub you have completed this lab. Please go to this link to submit via BCourses.

Above and Beyond: Git

If you would like to get a jumpstart in learning more about Git, check these resources

Above and Beyond: IDE

If you tried out Visual Studio Code, you can take a look at all of the plugins available that you can use to help with development. The benefit of Visual Studio Code is that it has an extensive extension library that you can take advantage of.

To start installing plugins you can go to Code -> Preferences -> Extensions

Some Extensions I recommend are:

  • Python
  • Docker
  • json
  • Markdown All In One