Programming Languages & Integrated Development Environments (IDEs) Flashcards
Card 1 of 24
All 24 cards in this deck
What is a high-level programming language?
A programming language written in a form close to human language, which must be translated into machine code by a compiler or interpreter before it can run.
What is a low-level programming language?
Machine code or assembly language — written for one specific type of processor and giving direct control of the hardware and memory.
Give two reasons why some programs are written in a low-level language.
Direct control of hardware/memory; faster execution time.
Also: machine code does not need translating, and the code can be optimised to use less memory.Give two reasons why a programmer would choose a high-level language.
It is easier and quicker to write, read and maintain; it is portable, so the same source code can be translated to run on different types of computer.
True or false? Machine code must be translated before a computer can run it.
False. Machine code does not need to be translated / compiled / interpreted — the processor executes it directly.
What is the purpose of a translator?
To convert source code into machine code so that the computer can execute the program.
Why do programs written in a high-level language need a translator?
Because a processor can only execute machine code (binary instructions), so high-level source code cannot be run directly.
Describe the characteristics of a compiler.
It translates the whole program in one go before it is run, produces an executable file, and reports all errors together at the end of compilation.
Describe the characteristics of an interpreter.
It translates and executes the program one line at a time, stops execution when it finds an error, and produces no executable file.
Give two benefits of using a compiler instead of an interpreter.
It produces an executable file, so end users do not need a translator; the program runs faster than the interpreted version.
Also: it only needs translating once, and the compiler can optimise the code.What does IDE stand for?
Integrated Development Environment — software providing tools that help a programmer write, run and debug programs.
How does the editor in an IDE help a programmer develop a program?
It allows program code to be written, entered and changed (and errors fixed), with features such as line numbering, auto-indent, keyword highlighting and autocomplete.
How do error diagnostics (the debugger) in an IDE help a programmer?
They identify and find errors, show the location and detail of each error, and can suggest fixes.
What does the run-time environment (output window) in an IDE let a programmer do?
Run/execute the program inside the IDE and see its output.
What does the translator built into an IDE do for the programmer?
Converts the source code into low-level/machine code so the program can be run; a compiler also produces an executable file.
Which IDE tool lets a programmer stop a running program at a chosen line to check it?
A break point.
Which IDE tool lets a programmer see the contents of variables and how they change while a program runs?
Variable watch.
A programmer is still writing and testing a program, changing it after every run. Should they use a compiler or an interpreter, and why?
An interpreter — it runs the code straight away without re-translating the whole program, and stops at the error so its location is easy to find.
Give two disadvantages of writing a program in a low-level language.
Any two of: the code is difficult to read, write and debug; it is not portable, as it normally runs on only one type of processor; it takes longer to write.
Give two disadvantages of a high-level language compared with a low-level language.
Any two of: it must be translated before it can run; the program usually runs more slowly; it tends to use memory less efficiently; it gives less direct control of the hardware.
How many machine code instructions does one high-level statement usually stand for, compared with one assembly language instruction?
One high-level statement usually stands for many machine code instructions. One assembly language instruction usually stands for just one machine code instruction.
Which level of language requires the programmer to understand how the processor is built and how it handles memory: high-level or low-level?
Low-level. A high-level programmer does not need to know about the processor's internal structure or how memory is managed.
Give two drawbacks of using a compiler.
Any two of: translating the whole program can take a long time; errors are only reported, all together, after compilation finishes, which can make them harder to track down; the program must be recompiled after every change.
Give two drawbacks of using an interpreter.
Any two of: the program runs more slowly, because each line is translated every time it runs; the interpreter must be present every time the program is run; the source code has to be given to users, so it can be seen and copied.