Computers π» | Programming Languages! Translators! IDEs! | 4.2 Flashcards
Define machine code
A binary programming language, for which the code can be loaded and executed without translation.
Define high-level language
(HLL)
A programming language that is independent of computer hardware, that has to be translated into machine code before being executed
Define low-level language
(LLL)
A programming language that is dependent on computer hardware
What are two examples of low-level languages?
Assembly language and machine code
Define assembly language
A programming language that is dependent on computer hardware, for which a program has to be translated into machine code before being executed. It uses mnemonics
Machine code is usually shown in what number system?
Hexadecimal
What are the advantages of high-level languages?
- Independent of the type of computer being used
- Easier to read, write, and understand programs
- Quicker to write programs
- Programs are easier and quicker to debug
- Easier to maintain programs in use
- Portable
What are the disadvantages of high-level languages?
- Programs can be larger
- Programs can take longer to execute
- Programs may not be able to make use of special hardware
What are the advantages of low-level languages?
- Can make use of special hardware
- Includes special machine-dependent instructions
- Can write code that doesnβt take up much space in primary memory
- Can write code that performs a task very quickly
What are the disadvantages of low-level languages?
- It takes a longer time to write and debug programs
- Programs are more difficult to understand
Why are high-level languages easier to understand?
They are closer to english and real world languages
Why may some programmers write programs in an assembly language?
- To make use of special hardware
- To make use of special machine-dependent instructions
- To write code that doesnβt take up much space in primary memory
- To write code that performs a task very quickly
Define translator
Converts a program written in a high-level language into machine code
What is needed to translate an assembly language program into machine code?
An assembler
Why is there need of translators?
Humans find it very difficult to read binary, but computers can only perform operations written in binary
Define compiler
A computer program that translates a source program written in a high-level language to machine code
What does a compiiler do if an error is found?
An error report is produced instead of a compiled program
Define interpreter
A computer program that analyses and executes a program written in a high-level language line-by-line
What does an interpreter do when it detects errors?
The execution of the program ceases if an error is detected on a statement. An error message is output; sometimes a suggested corrections is provided
How does the use case of compiled, interpreted, and assembled programs differ?
- Compiled and assembled programs are usually distributed for general use
- An interpreter is often used when a program is being developed
What are the advantages of interpreters?
- Easier and quicker to debug and test programs during development
- Easier to edit programs during development
What are the disadvantages of interpreters?
- Programs cannot be run without the interpreter
- Programs can take longer to execute
What are the advantages of compilers?
- A compiled program can be stored ready for use
- A compiled program can be executed without the compiler
- A compiled program takes up less space in memory when executed
- A compiled program is executed in a shorter time
What are the disadvantages of compilers?
It takes a longer time to write, test, and debug programs during development
Define Integrated Development Environment
(IDE)
A suite of programs used to write and test a computer program written in a high-level language
What are the common features of IDEs?
- Code editors
- A translator
- A runtime environment with a debugger
- Error diagnostics
- Autocompletion
- Autocorrection
- An autodocumenter and prettyprinting
What is the benefit of a code editor?
In an IDE
It allows a program to be written and edited without the need to use a seperate text editor, speeding up the program development process, as editing can be done without changing to a different piece of software each time the program needs correcting
How are interpreters and compilers used in IDEs?
- Interpreters are used for developing the program
- Compilers are used to produce the final version of the program to be used
Define debugger
A program that runs the program under development and allows the programmer to stop the execution of the program at a certain point in the source code.
How do report windows help with debugging in an IDE?
They show the contents of the variables and expressions evaluated at a certain point in the program, allowing the programmer to see if there are any logic errors in the program
Explain the function of error diagnostics and autocorrection
In an IDE
Dynamic error checking finds possible errors as the program code is being typed, alerting the programmer at the time and providing a suggested correction
Explain how auto-completion works
In IDEs
Code editors can offer context-sensitive prompts with text completion for variable names and reserved words
Define prettyprinting
Displaying source code using different colours and formatting, making the code easier to read and understand