2.5.1 Languages Flashcards

1
Q

What is a high-level programming language?

A

A high-level language has a syntax and structure similar to English that is designed to be understood by humans

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

Why is a translator necessary?

A

High-level languages have to be converted into machine code (binary) in order to be processed. In order to convert high-level languages into machine code we must use a compiler or interpreter.

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

Why do computers use binary?

A

Computers are made up of millions of transistors(switches) which can only represent two states ( ON and OFF)

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

What are 2 differences between compilers and interpreters?

A

-A compiler translates the whole program in one go and an interpreter translates the code line-by-line.

-A compiler would produce all the errors in a file at the end of compilation while an interpreter stops translation when it finds an error. This is useful for debugging.

-A compiler produces an executable file which does not need to be compiled again. With an interpreter the original code must be interpreted every time it is run.

-There is no need for the compiler to be present when the object/executable file is run. The interpreter must be installed to run the program.

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

What are the benefits of using a compiler?

A

-Compilers produce an executable program: There is no need to repeat this process more than once per version of the software.

-Compilers hide the source code from the end user: This helps to protect developers’ intellectual property.

-No source code needed afterwards

-Fast to execute afterwards

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

What are the drawbacks of using a compiler?

A

-The compilation process can be very slow: This can slow down development if many small changes need to be made. However, it is faster than an interpreter.

-Errors only shown right at the end

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

What are the benefits of using an interpreter?

A

-Interpreted languages are ‘portable’: This means that they can be run on many different types of central processing unit as long as there is an interpreter available for the platform.
-Errors discovered straight away

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

What are the drawbacks of using an interpreter?

A

-Running an interpreted program is slower than a compiled program
because we have to translate each line every time we run the software. But it is quicker to get started which can be good for small changes.
-Source code needed to run
-Slower to execute

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

What is a low-level language?

A

A language that does not closely resemble a natural human language, making it harder for humans to understand and write in.

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

What are the 2 forms of low-level language?

A

Machine Code (Binary)
and
Assembly Language (Specialised commands - bits + English

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

State the pros/cons of high-level languages

A

-High-level languages are more easily written by humans
-High-level languages are more easily understood by humans
-High-level languages are portable (can be run on many different CPUs)

-High-level languages are slow to execute

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

State the pros/cons of low-level languages

A

-Low-level languages are easier to optimise

-Low-level languages allow the user to directly manipulate memory

-Low-level languages are specific to particular CPUs

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