the Coding Environment
The Coding Environment
Terminal (or Command Line)
Every computer (Mac, Windows, or Linux) has a Terminal (Command Line in Windows). To open it, find the application on your computer, and double click to open it.
You can think of the terminal (or command line) as a way to talk directly to your computer by typing simple instructions. Instead of clicking or dragging icons or buttons (like you would if you wanted to move folders across your computer), you use short text commands to quickly navigate through your files, start programs, or automate tasks.
the Terminal
We will be using the terminal a LOT in our course. Make sure to do the practice problems if you have never used the Terminal before.
The Terminal on a Mac:
The Command Line on a Windows:
The following are some basic commands that are useful to know in the Termina/Command-Line:
Action | macOS / Linux (Terminal) | Windows (Command Prompt) |
---|---|---|
Show current location | pwd | cd |
List files & folders | ls | dir |
Change directory | cd foldername | cd foldername |
Go up one directory | cd .. | cd .. |
Create folder | mkdir foldername | mkdir foldername |
Create empty file | touch filename.txt | type nul > filename.txt |
Copy file | cp file1.txt file2.txt | copy file1.txt file2.txt |
Move or rename file | mv old.txt new.txt | move old.txt new.txt |
Delete file | rm filename.txt | del filename.txt |
Delete empty folder | rmdir foldername | rmdir foldername |
Clear terminal screen | clear | cls |
Practice Problems (Highly recommend if youβve never used Terminal!)
- Create a new folder in your home directory.
Click to see answer
In MacOS:
cd ~mkdir my_new_folder
In Windows:
cd %HOMEPATH%mkdir my_new_folder
- List all the folders in your home directory. Your new folder should be one of the folders listed.
Click to see answer
In MacOS:
ls
In Windows:
dir
- Navigate into your new folder.
Click to see answer
In MacOS and Windows:
cd my_new_folder
- Make a new txt file inside this new folder that says βYOUR SECRET KEY: 12lka09werk;as93kfls!β inside of it (only using Terminal/Command Line prompts).
Click to see answer
In MacOS:
echo "YOUR SECRET KEY: 12lka09werk;as93kfls!" > secret_key.txt
In Windows:
echo YOUR SECRET KEY: 12lka09werk;as93kfls! > secret_key.txt
- Navigate to the Desktop of your computer.
Click to see answer
In MacOS:
cd ~/Desktop
In Windows:
cd %HOMEPATH%\Desktop
- Look for the file location of the secret key file (Hint: use a command like grep).
Click to see answer
In MacOS:
grep -rl "YOUR SECRET KEY" ~/
In Windows:
findstr /s /m "YOUR SECRET KEY" %HOMEPATH%\*.txt
- Move the secret key file to your desktop.
Click to see answer
In MacOS:
mv ~/my_new_folder/secret_key.txt ~/Desktop/
In Windows:
move %HOMEPATH%\my_new_folder\secret_key.txt %HOMEPATH%\Desktop\
Even after completing these exercises, we recommend you play around with these commands and get familiar with how the Terminal/Command-Line works.
Integrated Development Environment (IDE)
What are Integrated Development Environments? Think of an IDE as your coding studio! It is the application that you will be using to do all things related to developing your application.
The IDE is packed with features like a code editor, debugger, and even autocomplete, which gives you coding suggestions. It also allows you to navigate through your code files easily!
IDE
Different Components of an IDE:
- File Access: Choose which files to access and edit in your project
- Text Editor: Write and edit code
- Terminal (or Command prompt): Run commands
- AI Assistant Where you can prompt AI to generate code and give you tips
Cursor is an AI tool that functions as an IDE. The image above actually shows the Cursor IDE. You will be using it to write, debug, test, and deploy your code. You will want to download it and make sure you are comfortable with using it!
Some cool tricks:
- Command + click (or control + click on Windows) certain lines of code and itβll show you where..
- Command + p (or control + p on Windows) allows you to search for any file in your project
- Command + shift + p (or control + shift + p on Windows) allows you to search for any command in your IDE
- Command + click some line of code, and it will bring you to the source code (where it is defined) in a multi-file project.
If you want a non-AI IDE, we highly recommend downloading VSCode. Otherwise, use the steps in the Getting Started section to download Cursor!