Unit:4 Software: CODING Flashcards
(25 cards)
What is a low level language?
A low-level language is a programming language that directly translates to machine code understood by the processor
What is a first-generation language
Machine code
Second generation
Assembly code is a second-generation language
How is assembly code written?
The code is written using mnemonics, abbreviated text commands such as LDA (Load), STA(Store)
How is assembly code translated to machine code?
Using an assembler
Advantages of low-level languages?
Complete control over the system components
Occupy less memory and execute faster
Direct manipulation of hardware
Disadvantages of low level languages
Difficult to write and understand
Machine dependent
Prone to errors
Knowledge of computer architecture is key to program effectively
Why are low-level languages fast?
They allow direct control over hardware which leads to greater efficiency.
What is a high level language?
A high-level programming language uses English-like statements to allow users to program with easy to use code
Advantages of high level languages
Easier to read and write
Easier to debug
Portable so can be used on any computer
One line of code can perform multiple commands
Disadvantages of high level languages
The user is not able to directly manipulate the hardware
Needs to be translated to machine code before running
The program may be less efficient
What is a translator?
A translator is a program that translates program source code into machine code so that it can executed directly by a processor
How are high level languages translated to machine code
translated using a compiler or interpreter
What is a compiler?
A compiler translates high-level languages into machine code all in one go
Advantages of compiler
-Speed of execution
-Optimises the code
- Original source code will not be seen
Disadvantages of compiler
Can be memory intensive
Difficult to debug
Changes mean it must be recompiled
It is designed solely for one specific processor
What is an interpreter?
An interpreter translates high-level languages into machine code one line at a time
Advantages of interpreter
Stops when it finds a specific syntax error in the code
Easier to debug
Require less RAM to process the code
Disadvantages of interpreter
Slower execution
Every time the program is run it has to be translated
Executed as is, no optimisation
What is an IDE?
An Integrated Development Environment (IDE) is software designed to make writing high-level languages more efficient
Features of an IDE
Editor
Error diagnostics
Run-time environment
Built in Translators
What does the editor do?
An editor gives users an environment to write, edit and maintain high-level code
Features of editor
Basic code formatting tools - changing the font, size of the font and making text bold etc
Prettyprint - using colour to make it easier to identify keywords, for example ‘print’, ‘input’ and ‘if’ in Python
Code editing - auto-completion and auto-correction of code, bracket matching and syntax checks
Commenting code - allows sections of code to be commented out easily to stop it from being run or as comments on what the program is doing
What are error diagnostics
Tools that help to identify, understand and fix errors in code, such as:
Identifying errors - highlight particular areas of code or provide direct error messages where the error may have appeared e.g. indentation errors etc
Debugger - provide a ‘step through’ command which provides step by step instructions and shows what is happening to the code line by line, useful for finding logic errors