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

Free lesson

OS 5.2 (3 of 3): IDEs and code collaboration

The whole lesson, free. Read it and have a go at the activities. To work the tasks and labs in the real lesson, press Start lab, with no account needed.

50 minutes

A quick check that you are not a bot, then your own lab opens on the interactive lesson.

Already have an account? Sign in

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 code one step at a time to find a bug.
DebugFind and fix a mistake in code.
BreakpointA line where the debugger stops to show 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 after the team reviews them.
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 sharingEditing one file together 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.

Match the feature

Have a go

Loading…

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

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.

Check: IDE and team tools

Have a go

Check: IDE and team tools

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

Print the values to find a bug

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.

Make a free account to save your work and track your progress.

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.

Watch a loop change its total

Code: python
total = 0
for price in [2, 3, 4]:
    total = total + price
    print("after", price, "total is", total)

# This is what a debugger shows you, line by line.
# Change the list and run again.

Make a free account to save your work and track your progress.

Find and fix four bugs

Each of the four functions has a bug. Use the steps from this lesson. Print the values, find the first wrong one, then change one thing at a time. The hidden tests check each function and its edge cases. Press Run Tests.

Code: python
def running_total(prices):
    # [2, 3, 4] must give back [2, 5, 9].
    return prices


def count_vowels(text):
    # Count a, e, i, o, u in any case. "Education" has 5.
    count = 0
    for letter in text:
        if letter == "a":
            count = count + 1
    return count


def last_word(text):
    # "the bus is late" must give back "late".
    return text.split()[1]


def first_negative(numbers):
    # Give back the position of the first number below 0, or -1 if there is none.
    for position in range(1, len(numbers)):
        if numbers[position] < 0:
            return position
    return -1

Make a free account to save your work, or press Start lab to work through the whole lesson.

Key words crossword

Have a go

Loading…

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

Exit quiz

Have a go

Exit quiz

5 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

Teach this lesson with your class

On a college account your students work the tasks and the labs as well, and every mark is kept for you.