Lesson 4 of 296
Your tools
What you will learn
- What a code editor is and which one to use
- What browser developer tools are and how to open them
- What the terminal is and the first commands to know
On this page
1. The code editor
Code is plain text. You could write it in Notepad, but a code editor is made for the job. It gives you:
- colours for different parts of the code, so it is easier to read
- warnings when you make a typing mistake
- a list of all the files in your project
- a built-in terminal
The most used editor is Visual Studio Code (VS Code). It is free and works on Windows, Mac and Linux. This course uses it.
Important for interviews: many coding tests use a very simple editor with no automatic help. Practise sometimes with auto-complete switched off so you can write code from memory.
2. Browser developer tools
Every modern browser has a hidden panel for developers called developer tools, or dev tools.
How to open it in Chrome:
| Computer | Keys |
|---|---|
| Windows / Linux | F12 or Ctrl + Shift + I |
| Mac | Cmd + Option + I |
You can also right-click anywhere on a page and choose Inspect.
The three tabs you will use most:
| Tab | What it shows |
|---|---|
| Elements | The HTML and CSS of the page. You can change them and see the result at once. |
| Console | Messages and errors from JavaScript. You can also type JavaScript here and run it. |
| Network | Every request the page sends and every response it gets. |
Try it: the Console
Open dev tools, click the Console tab, type this and press Enter:
2 + 2The console shows 4. You have just run JavaScript. Now try:
console.log("Hello");It shows Hello. console.log() is the command that prints a value in the console. Developers use it all the time to check what their code is doing.
3. The terminal
The terminal (also called the command line) is a window where you control the computer by typing commands, not by clicking. Developers use it to start projects, install tools, run code and use Git.
How to open it:
| Computer | How |
|---|---|
| Mac | Open the app called Terminal |
| Windows | Open PowerShell, or install WSL to get a Linux terminal |
| VS Code | Menu: Terminal, then New Terminal |
First commands
These work on Mac, Linux and WSL.
| Command | What it does | Example |
|---|---|---|
pwd | Shows which folder you are in now | pwd |
ls | Lists the files in this folder | ls |
cd | Moves to another folder | cd projects |
cd .. | Moves up one folder | cd .. |
mkdir | Makes a new folder | mkdir my-site |
touch | Makes a new empty file | touch index.html |
clear | Cleans the screen | clear |
Example session
pwd shows: /Users/sam
mkdir my-site makes a folder called my-site
cd my-site goes into it
touch index.html makes an empty file
ls shows: index.htmlPart 8 teaches the terminal in more detail.
Common mistakes
- Typing a command in the wrong folder. Always check with
pwdfirst. - Ignoring the Console tab. When a page does not work, the Console usually already shows the reason in red.
- Capital letters. The terminal treats
Projectsandprojectsas different names on most systems.
How to say it in an interview
"I use VS Code as my editor. I use the browser dev tools daily: the Elements tab to inspect HTML and CSS, the Console to see errors and test JavaScript, and the Network tab to check requests and responses. I am comfortable in the terminal for running projects, installing packages and using Git."
Key words
| Word | Meaning |
|---|---|
| Code editor | A program for writing code |
| Dev tools | The developer panel built into the browser |
| Console | The place where JavaScript messages and errors appear |
| Terminal | A window where you type commands to control the computer |
| Command | One instruction typed into the terminal |
Now prove it
This lesson is complete when you pass the quiz and all three practice levels.