9.1: IDE Tools
Eduqas / WJEC
An IDE (Integrated Development Environment) provides programmers with the following facilities (tools) to help create programs:
The editor is software that allows a programmer to enter and edit source code.
Editor features may include:
Automatic formatting (e.g. automatic indentation).
Automatic line numbering (this helps to identify exactly where an error has occurred).
Automatic colour coding (e.g. Python turns loop commands orange and print commands purple).
Statement completion (e.g. offering to auto-complete a command as the user is typing.)
A library is a collection of commonly used functions and subprograms that can be linked to a program.
For example, Python can import functions from its code library including random or time commands).
Libraries must be linked to the main program using a linker.
Links together pre-compiled code from software libraries. For example, the import random command in Python links to the random library.
Pre-compiled code is loaded into RAM to be executed.
The code is optimised so it is fast, efficient and uses as little of the computer's resources as possible.
Identifies errors in the code with the exact line of the error to help fix the problem.
The programmer selects a specific line and the program displays the variable values at that point.
The code can then be executed one line at a time to find exactly where the error occurs -this process is called single-stepping.
Displays the current value of a selected variable.
A variable can be watched line-by-line to see how the value changes.
Logs the values of variables and outputs of the program as the code is executed line by line.
Displays the contents of a section of memory and how it is being used by the program.
Displays information about an error when it occurs, such as the line it occurred on and the error type (e.g. syntax or runtime). This helps the programmer to fix the error.
Specific errors can be detected such as a syntax error. See 10.3.
Compilers & Interpreters
Both tools convert the source code written by a programmer into machine code to be executed by the CPU.
A compiler converts the entire source code into executable machine code at once. After compilation, the program can be run again without having to recompile each time.
An interpreter converts source code into machine code line by line. An interpreter must reinterpret the code each time the program is required to run. See 10.1 for both tools.
Subroutines & Functions
A subroutine is a section of code that can be re-used several times in the same program.
There are two types of subroutines:
A procedure just executes commands, such as printing something a certain number of times.
A function can receive data from the main program (called a parameter) and return a value upon completion.
Subroutines (procedures and functions) are designed to be repeated and have three key benefits:
Subroutines make programs easier to read and design.
They reduce the duplication of code.
Makes it is easier to debug a program.
9.1 - IDE Tools:
1. Describe the purpose of each type of IDE facility:
g. Break point
h. Variable Watch
j. Memory Inspector
k. Error Diagnostics [2 each]