Choosing a Translator Flashcards
All 4 cards in this deck
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.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 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.