2.5 New Flashcards

(35 cards)

1
Q

What is a low level language

A

A programming language that directly translate to machine code understood by the processor, allowing direct control over hardware components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Features of low level languages

A

-directly translates to machine code
-allows direct control over hardware
-written for specific processors to ensure they embed the correct machine architecture
-does not closely resemble a natural human language, making it harder for humans to understand and write in
-executes more quickly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why are low level languages used

A

-when programmers need to write code that interacts directly with the hardware, such as device drivers
-when a program must be executed quickly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Machine code (first generation) features

A

-pure binary code that computers can directly process and execute
-tedious and difficult for humans for humans to understand and write this
-can be used when a programmer needs to perform a very specific command that cannot be done in high level language
-executed faster because it is in a format the CPU can execute and does not need to be translated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Features of assembly (second generation language)

A

-uses specialised command mnemonics to perform actions
-easier to understand and spot errors than machine code
-faster to execute than high level languages and can be used to directly control the CPU
-needs to be translates to machine code for the computer to execute it (one assembly instruction = one machine code instruction)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Advantages of high level languages

A

-complete control over the system components
-occupy less memory and execute faster
-direct manipulation of hardware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Disadvantages of low level languages

A

-difficult to write and understand
-machine dependent
-more prone to errors
-knowledge of computer architecture is key to program effectively

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are high level programming languages

A

Programming languages that use English like statements to allow users to program with easy to use code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Features of high level languages

A

-code that is similar to natural human language, easy to understand and use
-fewer errors and more powerful and complex commands than low level languages
-must be translated into machine code before it can run
-one instruction translates into many machine ode instruction
-clear debugging and programs are easier to maintain
(Needed due to development of processor speeds and increase in memory capacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Advantages of high level programming languages

A

-Easier to read and write
-easier to debug
-portable(can run on different types of hardware) so can be used on any computer
-one line of code can perform multiple commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Disadvantages of high level programming languages

A

-user is not able to directly manipulate the hardware
-needs to be translated to machine code before running
-program may be less efficient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a translator

A

A program that changes (translates) program source code into machine code so that it can be executed directly by a processor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what difference is there in the translation of high level languages and low level languages

A

-low level languages are translated using an assembler
-high level languages are translated using compilers or interpreters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

interpreter

A

converts high level languages one line at a time into machine code and executes it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

compiler

A

converts high level language into machine code for execution at a later time. The entire program is converted at once

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how do interpreters translate and execute code

A

-an interpreter translate source code (high level code) into machine code one line at a time
-must be reinterpreted every time the program is run
-can run and be edited without translating the whole program

17
Q

how do compilers translate and execute code

A

-a compiler translates all the source code into machine in one code
-produces an executable file that will run on other machines without the compiler needing to be installed
-only need to be translated once
-compiled programs have to recompiled after any changes are made

18
Q

how do interpreters report errors

A

-the interpreter would encounter the errors and report it to the user immediately and stops the program from running

19
Q

how do compilers report errors

A

the compiler analyses the entire program, taking note of where errors have occurred and records them in an error file, before it is run

20
Q

difference in complexity of compiler programs and interpreter programs

A

-interpreters are smaller, simpler programs
-compilers are larger, complex programs

21
Q

difference in execution speed of compilers and itnerpreters

A

-interpreters are slower as the code must be reinterpreted each time the program is run
-compilers produce more efficient code that interpreters making the compiled programs run faster, also do not have to be recompiled every time it is run

22
Q

advantages of interpreters

A

-instructions are executed as soon as they are translated, requiring less RAM
-stops when a syntax error is found, errors spotted easily, easier to debug

23
Q

disadvantages of interpreters

A

-slower execution
-must be translated every time it is run
-code is not optimised
-no executable file that can be distributed, source code must be supplied which can be modified without permission

24
Q

advantages of compilers

A

-faster execution, code already translated
-optimises the code, less RAM and time
-executable file can be distributed, source code will not be seen

25
disadvantages of compilers
-more memory as whole source code needs memory -difficult to debug: does not spot errors, program must be compiled and run before errors can be seen -source code must re-compiled every time programmer changes the program -designed for one specific processor
26
what are IDEs
software designed to make writing high level languages more efficient
27
features of IDEs
-editor -compilers and interpreters (translators) -error diagnostics -run-time environment
28
what is an editor
software that allows a programmer to enter and edit source code
29
features can editors provide
-formatting tools (automatic indentation and changing font and format of word) -colour coding -statement completion -commenting code -line numbering
30
errors diagnostics description
-tools that help to identify, understand and fix errors in code -such as identifying errors, debugger, line number of error
31
run time environment description
gives users the ability to run and see the corresponding output of a high level language
32
translator description for IDEs
built in to compile or interpret code without the need for extra piece of software
33
Difference between compilers and interpreters
-compilers translates all the code in one go, interpreters translates one line at a time -compilers create an executable, whereas an interpreter does not, executes one line at a time -compiler reports all errors at the end, an interpreter stops when it finds an error
34
Types of defensive design
-Input sanitation -validation -verification -authentication -maintainable code TESTING IS NOT INCLUDED
35