Chapter 4: How do I write programs? Flashcards
1
Q
Instruction set
A
Set of basic commands or instructions that a processor can understand directly
2
Q
Machine code
A
Instructions that can run directly on a computer’s processor
3
Q
Program
A
Set of instructions written to perform specific tasks on a computer
4
Q
Programming language
A
Language designed for humans to communicate instructions to computers
5
Q
Source code
A
Instructions written in a programming language that both humans and computers can understand
6
Q
Syntax
A
Rules that determine how the words and symbols in a valid instruction are arranged
7
Q
Syntax error
A
Result of incorrect source code that causes the translation process from source code to machine code to fail
8
Q
Compiler
A
- Code translator program that translate source code to machine code completely before running the program
- Advantages:
- Resulting program runs at faster speed as all
translation done beforehand - Compiler is not needed to run the program after
compilation is completed - Syntax errors are detected before the program even
runs
- Resulting program runs at faster speed as all
- Disadvantages
- Any changes to the source code require
recompilation before taking effect - Compilers usually do not offer an interactive mode
- Any changes to the source code require
9
Q
Interpreter
A
- Code translator program that translates source code to machine code while the interpreted program is running
- Advantages:
- Changes to the source code take effect immediately
- Interpreters usually have an interactive mode that
facilitates learning and experimentation
- Disadvantages:
- The resulting program runs at a slower speed
because translation occurs when the program is
running - Needs to be run every time the program is started
- Syntax errors may interrupt the running of the
program
- The resulting program runs at a slower speed