A workshop for code
A carpenter (a person who makes things from wood) does not work with only a saw. The workshop has a bench, a light, a ruler and a tool for every job.
A developer has a workshop too. It is called an IDE. One program holds the editor, the tools to run the code, and the tools to find mistakes.
Key words
| Word | What it means |
|---|---|
| IDE | Integrated development environment. One program with an editor, a runner and a debugger. |
| Debugger | A tool that runs your code slowly so you can watch each step and find a bug. |
| Debug | Find and fix a mistake in code. |
| Breakpoint | A line where the debugger stops so you can look at the values. |
| Version control | A tool that records every change to your files so you can go back. |
| Repository | A store for a project and its full history. |
| Pull request | A request to merge your changes, so the team can review them first. |
| Plugin | An extra feature you add to a tool. |
| Refactoring | Changing code so it is cleaner but does the same job. |
| Issue tracker | A list of bugs and tasks that the team shares. |
| Live sharing | Two or more people edit the same file at the same time, from different places. |
The cells students fill in are left blank in this preview.
What an IDE gives you
| Feature | What it does | Why it helps |
|---|---|---|
| Editor | Colours the code, finishes words, shows mistakes as you type | You find typing mistakes at once |
| Run button | Runs the program from inside the IDE | No need to switch windows |
| Debugger | Stops at breakpoints and shows the values | You see what really happens |
| Plugins | Adds languages and tools | One IDE fits many jobs |
| Version control | Git buttons inside the IDE | Commit without leaving your code |
| Refactoring | Renames a name everywhere safely | Cleaner code with fewer mistakes |
The cells students fill in are left blank in this preview.
Choosing an IDE
There are many IDEs. Some are for one language, such as PyCharm for Python. Some are for many languages, such as Visual Studio Code with plugins. Some cost money and some are free.
Ask: which language? Which computer? What does the team already use? Can it share code with the team?
Technology for code teamwork
A team needs more than an IDE.
Code hosting holds the shared repository, such as Gitea, GitHub or GitLab.
Pull request review tools let people comment on lines and approve a change.
Issue trackers list bugs and tasks. Live sharing lets two people edit one file together.
Quick check
Have a go
Quick check
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Try it: look at the values
def last_two(items):
return items[-2] # a bug: this is only one item
data = [4, 8, 15, 16]
print("data is", data)
print("result is", last_two(data))
# The result should be [15, 16]. Fix last_two and run it again.
A way to find any bug
- Say what you expected and what you got.
- Find the first place where the values are wrong. Use print, or a breakpoint in the IDE.
- Change one thing.
- Run again.
Change only one thing at a time. If you change three things, you do not know which one helped.