Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

IDEs and code collaboration

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

50 minutes

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

WordWhat it means
IDEIntegrated development environment. One program with an editor, a runner and a debugger.
DebuggerA tool that runs your code slowly so you can watch each step and find a bug.
DebugFind and fix a mistake in code.
BreakpointA line where the debugger stops so you can look at the values.
Version controlA tool that records every change to your files so you can go back.
RepositoryA store for a project and its full history.
Pull requestA request to merge your changes, so the team can review them first.
PluginAn extra feature you add to a tool.
RefactoringChanging code so it is cleaner but does the same job.
Issue trackerA list of bugs and tasks that the team shares.
Live sharingTwo 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

FeatureWhat it doesWhy it helps
EditorColours the code, finishes words, shows mistakes as you typeYou find typing mistakes at once
Run buttonRuns the program from inside the IDENo need to switch windows
DebuggerStops at breakpoints and shows the valuesYou see what really happens
PluginsAdds languages and toolsOne IDE fits many jobs
Version controlGit buttons inside the IDECommit without leaving your code
RefactoringRenames a name everywhere safelyCleaner 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 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Try it: look at the values

Code: python
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

  1. Say what you expected and what you got.
  2. Find the first place where the values are wrong. Use print, or a breakpoint in the IDE.
  3. Change one thing.
  4. Run again.

Change only one thing at a time. If you change three things, you do not know which one helped.

The lesson goes on

4 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.