Skip to content

2.5.2 The Integrated Development Environment (IDE)

GCSE · Paper 2 · Computational thinking, algorithms and programming · Section 2.5 · 17 flashcards · 10 practice questions

Questions

2.5.2 The Integrated Development Environment

Programmers do not usually write code in a plain document and then use many separate programs to run it. They use one package of tools called an IDE.

Definition
An Integrated Development Environment (IDE) is a piece of software that brings together the tools a programmer needs to write, test and run programs in one place.

You need to know four features of an IDE: the editor, error diagnostics, the run-time environment and the translators. For each one, know what it is and how it helps a programmer.

Editor

Definition
The editor is the part of the IDE where you type and change your source code.

A basic text editor only lets you type. The editor in an IDE has extra features that make code easier to write and read.

FeatureWhat it doesHow it helps
Line numbersShows a number beside each lineError messages say which line to look at, so the mistake is easy to find
Syntax highlightingShows keywords, strings, numbers and comments in different coloursThe code is easier to read, and a missing quote or misspelt keyword is easy to spot
Auto-completeSuggests the rest of a word or command as you typeSaves time and cuts down on spelling mistakes
Auto-indentMoves code in automatically after an if or a loopKeeps the structure of the code clear and easy to follow
Bracket matchingShows which bracket closes the one you are onHelps you avoid missing or extra brackets
Commenting toolsMarks lines as comments with one keySaves time and makes it easier to explain code
Find and replaceSearches the code for a word and can change it everywhereQuick to make the same change in many places
pseudocode
// Syntax highlighting would colour this code
for i = 0 to 9
    print("Number " + str(i))
next i
Key Point
The editor does not run the program. It helps you write correct code faster, and makes it easier to read.

Error diagnostics

Definition
Error diagnostics are tools that help a programmer find and fix mistakes in their code.

There are two kinds of tool: those that find errors in the code before it runs, and those that help you look at the program as it runs.

Finding errors

  • •
    The IDE can highlight a mistake, such as a missing bracket, a misspelt word or a missing endif, as soon as you type it. It may underline the code or show a marker next to the line.
  • •
    After translation, the IDE shows an error report. It gives the line number and a message that says what is wrong. This saves you from searching through the whole program.
  • •
    Messages explain the type of error, for example a syntax error (the code breaks the rules of the language) or a run-time error (the program stops while it runs).

Debugging tools

A logic error does not stop the program, but gives the wrong answer. These are the hardest to find, so an IDE offers tools to look inside the program while it runs:

  • •
    Breakpoints: you mark a line where the program should pause. You can then check the values of the variables at that point.
  • •
    Stepping: run one line at a time, so you can watch what happens after each line.
  • •
    Variable watch: shows the current values of the variables as the program runs. This works like a trace table that fills itself in.
Worked Example
A program should add up the numbers 1 to 5 but the answer is wrong.

total = 0
for i = 1 to 4
total = total + i
next i
print(total)

Using stepping and a variable watch, the programmer sees that the loop stops when i is 4. total is 10, not 15. The programmer then sees that the loop should be for i = 1 to 5.
Remember
Diagnostics do not fix the code for you. They show where and what the problem is, so you can fix it.

Run-time environment

Definition
The run-time environment is the part of the IDE that lets you run the program and see it working, so that you can test it, without leaving the IDE.

With a run-time environment the programmer can:

  • •
    Run the program at the click of a button.
  • •
    Type in data and see the output, for example in a built-in console or window.
  • •
    Test the program with different data.
  • •
    See run-time errors when the program stops, with a message and the line where it happened.
  • •
    Stop a program that is stuck, for example one that has been caught in an endless loop.
This helps because the programmer can write a bit of code, run it, find out what is wrong, change it and run it again in one place. It is quicker than switching between programs. It also helps test the program in the same set-up it will be used in.

Translators

An IDE includes a translator, which is a compiler or an interpreter (see topic 2.5.1). It turns the source code into machine code so the program can run.

How the translator helps:

  • •
    The programmer does not need to install or start a separate translator.
  • •
    The program can be translated and run with one click.
  • •
    The translator reports errors in the IDE, with line numbers, next to the code.
  • •
    Some IDEs can work with different translators for different languages, so one IDE can be used for several languages.

Summary of the four features

FeatureWhat it isHow it helps
EditorWhere code is typed and changedEasier to write and read code, with fewer typing mistakes
Error diagnosticsTools to find and understand errorsLocates and explains mistakes quickly
Run-time environmentLets you run and test the programTest and fix in one place
TranslatorsTurn the code into machine codeProgram is translated without leaving the IDE
Warning
Do not say that the IDE "writes the program for you" or "fixes the errors". It helps the programmer by showing, suggesting and reporting. The programmer still has to make the changes.

Exam technique

  • •
    State or give: name a feature. "Give two features of an editor in an IDE."
  • •
    Describe: say what the tool does. "Describe what is meant by error diagnostics."
  • •
    Explain how a feature helps: give a reason. "Syntax highlighting helps because keywords are in different colours, so a misspelt word is easier to spot."
  • •
    Name the feature and then say the benefit to the programmer. A feature on its own earns the mark only if you say what it does.
  • •
    Use the correct term for the part of the IDE: editor, error diagnostics, run-time environment, translator.
  • •
    "It makes it easier" is too vague. Say what is easier and why.