You are on page 1of 17

4.

3 Further programming

4.3.4 Use of development tools /


programming environments
Features found in a typical Integrated
Development Environment (IDE)

Prettyprinting
• Prettyprint refers to t he presentation of t he
program code typed into an editor.
• It includes indentation, colour-coding of
keywords and comments.
Features found in a typical Integrated
Development Environment (IDE)

Context-sensitive prompts
• This feature displays hints or a choice of
keywords and available identifiers appropriate
at the current insertion point of the program
code.
Features found in a typical Integrated
Development Environment (IDE)

Dynamic syntax checks


• When a line has been typed, some editors
perform syntax checks and alert the
programmer to errors.
Program testing using the IDE
• Debugging is the action of finding and
correcting errors ('bugs') in a program. An IDE
often contains features to help with
debugging.

• Debugging: finding and correcting errors in a


program
Python (Debug using IDLE)
• To debug using IDLE, from the Python Shell
(see Figure 15.10), choose Debugger from the
Debug menu.
Python (Debug using IDLE)
• Open the source program from the File menu.
To set a breakpoint, right-click on the line you
want to set the breakpoint on.
• Start running the program by clicking the Go
button in the Debug Control window.
• The program stops at the breakpoint (Figure
15.11(a)).
• Then click the Step button to execute one
instruction at a time.
• The Debug Control window (Figure 15.11(b))
shows which line number is about to be executed
(line 4 in the example).
• The contents of all variables are also displayed in
the Debug Control window.
Compilers and interpreters
• The starting point for using either a compiler
or an interpreter is a file containing source
code, which is a program written in a high-
level language.
For an interpreter the following steps
apply:
For a compiler the following steps
apply:
Advantages and Disadvantages of creating
interpreted or compiled programs for programmers:

• An interpreter has advantages when a


program is being developed because errors
can be identified as they occur and corrected
immediately without having to wait for the
whole of the source code to be read and
analysed.
Advantages and Disadvantages of creating
interpreted or compiled programs for programmers:

• An interpreter has a disadvantage in that


during a particular execution of the program,
parts of the code which contain syntax errors
may not be accessed so if errors are still
present they are not discovered until later.
Advantages and Disadvantages of creating
interpreted or compiled programs for programmers:

• An interpreter has a disadvantage when a


program is error free and is distributed to
users because the source code has to be sent
to each user.
• A compiler has the advantage that an
executable file can be distributed to users so
the users have no access to the source code.
Advantages and Disadvantages of creating
interpreted or compiled programs for the users:
• For an interpreted program, the interpreter
and the source code have to be available each
time that an error-free program is run.
• For a compiled program, only the object code
has to be available each time t hat an error-
free program is run.
Advantages and Disadvantages of creating
interpreted or compiled programs for the users:
• Compiled object code will provide faster
execution than is possible for an interpreted
program.
• Compiled object code is less secure because it
could contain a virus .
• Whether an interpreter or a compiler is going
to be used, a program can only be run on a
particular computer with a particular
processor if the interpreter or compiler
program has been written for that processor.

You might also like