Exam Questions Flashcards
Describe, giving an example of each, two types of translation error
Syntax error - IF written in code without endif
Semantic error - variable declared illegally
Describe Agile and Waterfall approaches to analysis and design
Waterfall:
Sequential process
Developers draft the design of the system up front and it doesn’t change
Once the analysis and design stage is completed, developers cannot go back and make changes
Requires less communication between the client and developer
Agile:
Incremental approach to development
Start with simple project design requirements
Changes can be made after each phase of development, the analysis can be revisited, designs can be changed
There is strong, regular communication between the client and the developer
What is a compiler
Convert high level language (source code) into machine code (object code)
What is an interpreter
Runs a high level language program without converting it into a binary executable
Takes a line of the high level program (source code), translates it and runs it, then runs the next line etc.
Translates source code instructions line by line
Advantages of a compiler
Although compilation may take mins, it produces an executable that will be fast to run over and over again
Executable program can be given to the end user without them needing to have a compiler
Very difficult for the end user to edit the code as it is in binary format
Shows a list of errors in the program which must be corrected before compilation (can also be disadvantage)
Disadvantages of compiler
Compiling can be slow and tedious when developing a program (as each time program needs to be ran it has to be recompiled)
A compiler targets a particular platform and cpu instruction set e.g. programs compiled for android ARM processors won’t work on Intel x86 chips etc.
Commonly used for a number of languages e.g. python, javascript
Advantages of an interpreter
No delay in waiting for compilation, program can begin to run immediately (ideal for program development)
Should run on any computer as long as there is an interpreter available for the language
Disadvantages of an interpreter
Program will tun much more slowly as each line of code needs to be translated each time before it can run
Needs an interpreter to run it
End user has access to source code (can be stolen)
Only finds errors when it gets to a line with an error in, so program could have errors thst are never discovered until experienced by the end user
How does a compiler deal with translation errors
A compiler spots the errors and shows a list of errors in the program which must be corrected before compilation
How does an interpreter deal with translation errors
An interpreter will only find the error when it gets to the line with the error in, meaning it will be experienced by the end user