Programming Environment Setup for CS 340
Before you get started programming, you'll need to set up your programming environment. We highly recommend you set up your own computer as your development environment, and we believe that real-world, industry-standard tools that are used by millions of people every day are the best tools to use for your development environment.
Visual Studio Code
In lecture, you'll see me use Visual Studio Code for all programming. I recommend you set up VS Code yourself if you don't already have it installed (it's free).
- Install Microsoft's Visual Studio Code - Available for Windows, Mac, and Linux
C Programming Environment
Setting up an programming environment for C will depend on what operating system you are using and this page has a section for Windows, OS X, and Linux. Almost all C++ compiles can also compile C code, so most setup guides will be in the context of C++ even though you will be doing C in the MPs.
Windows
On Windows, we recommend setting up Windows Subsystem for Linux 2 (WSL2) with Ubuntu Linux. WSL2 is a virtualization tool that will allow you to run an installation of Linux, which has much better support for the tools used in CS 340.
After you Install WSL2, next you will need to set up both Ubuntu for C Development and Visual Studio Code:
Finally, create a cs340
directory inside of your Ubuntu home directory.
- Open Ubuntu in the same way as you did in Microsoft's Guide.
- Create your CS 340 directory:
waf@ILLINOIS:~$ mkdir cs340 # Create the cs340 directory
# When your prompt shows cs340, you're inside of the cs340 directory!
waf@ILLINOIS:~$ cd cs340 # Navigate into the cs340 directory
waf@ILLINOIS:~/cs340$ - You will use this directory for all your CS 340 work.
- If you want to access your Linux file system in Windows, you can visit the address
\\wsl$\Ubuntu\home\
inside of File Explorer to view your Linux home directory within Windows. It is possible to access your Windows file system from Linux (/mnt/c/...
), but this is slow, removes all file permission bits from Linux, and generally does not work as well.
- If you want to access your Linux file system in Windows, you can visit the address
Mac OS X
Since OS X is a Unix-like operating system, you will be able to run most Linux tools directly. However, since it's not Linux, there will be times that you will encounter unexpected behavior and will have to find workarounds. Where possible, we will support OSX as best as possible but it will not be perfect.
You will also need to create a cs340
folder. You can create it on your Desktop:
- Create your CS 340 directory:
waf@my-mac:~$ cd Desktop # Navigate to your Desktop
# When your prompt shows cs340, you're inside of the cs340 directory!
waf@my-mac:~/Desktop$ mkdir cs340 # Create the cs340 directory
waf@my-mac:~/Desktop$ cd cs340 # Navigate into the cs340 directory
waf@my-mac:~/Desktop/cs340$ - You will use this directory for all your CS 340 work. You will also find this folder as a visual folder on your desktop.
Linux
On Linux, setting up your environment should be as simple as installing the required packages for C development on your distribution. Microsoft has a guide to help you out if you out with getting Visual Studio Code set up: