Programming Languages and Translators · Cambridge syllabus 4.2 · Lesson 3 of 3
Integrated Development Environments
An IDE brings together the tools for writing a program: a code editor, a run-time environment to run it in, translators, error diagnostics, auto-completion, auto-correction and prettyprint, which lays the code out with colours and indentation so it is easier to read.
By the end, you can
- Understand the purpose of an integrated development environment.
- Identify code editors.
- Identify run-time environments.
- Identify translators.
- Identify error diagnostics.
- Identify auto-completion and auto-correction.
- Understand pretty-printing.
IDE features
An integrated development environment is a single program bringing together everything needed to write, translate, run and debug code, so that a programmer does not have to move between separate tools.
At the centre is the code editor, which is a text editor that understands the language: it colours keywords, strings and comments so structure is visible at a glance, indents automatically, matches brackets, and can collapse sections that are not being worked on.
A translator — compiler, interpreter or both — is built in, so code is run from inside the editor, and a run-time environment executes the program and shows its output in a window alongside the source rather than in a separate terminal.
Error diagnostics are what save the most time. Errors are underlined as the code is typed, before it is ever run, and when the program does fail, the environment reports the line and the kind of error.
Auto-completion suggests names and keywords as they are typed, saving keystrokes and preventing misspelt identifiers; auto-correction fixes obvious slips, such as a mistyped keyword; and prettyprint lays the code out with consistent indentation and colours keywords, which makes the structure visible and is worth doing to somebody else’s code before trying to read it.
Worth remembering
- Code editor, run-time environment and translators in one program.
- Error diagnostics show where errors are, often before the program is run.
- Auto-completion, auto-correction and prettyprint make code quicker to write and read.
Worked example
Typing Tot in an IDE offers Total from the identifiers already declared (auto-completion); typing ENDFI is changed to ENDIF (auto-correction); a missing ENDIF is underlined before the program runs (error diagnostics).
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
Prettyprint.
Check your method, units and explanation against it.
Marked practice
Set 1 of 4 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.