Lab 1b: Install Tools for Development

This lab will focus on ensuring you have the tools that you will need to jump in and build backend services.

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. It’s 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.

In order to unify the experience of everyone, I will be using a cross platform terminal called Hyper. However if you are comfortable with the terminal you use you can use what you see fit.

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. The setup for Hyper that I have below in this lab can do this for you, but there are a number of other ways to achieve the same result.

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.

For this lab

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: Hyper (or use your favorite Terminal Client)
    • Windows users: please install the windows subsystem (provided by Michael 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
    • I’ve removed the git-bash instructions because using the Windows Subsystem will alleviate a lot of other issues that you may have in the future.
  • 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
  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 Hyper
  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!

Once you have completed the lab, please submit the world “Completed” to BCourses at this link.

Above and beyond

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