2.5 Programming languages and IDEs Flashcards

1
Q

What is a high level language?

A

The source code is easy for humans to write but computers need to translate it before they can read and run it.

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

What are advantages of a high level language?

A

-One instruction of high level code represents many instructions of machine code.
-The same code will work for many different machines and processors.
-The programmer can easily store data in lots of different structures (lists and arrays) without knowing about the memory structure.
-Code is easy to read, understand + modify.

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

What are disadvantages of a high-level language?

A

-Must be translated into machine code before a computer is able to execute instructions as computers can only understand instructions given to them in machine code.
-Don’t have much control over what the CPU actually does so programs will be less memory efficient and slower.

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

What are 2 types of translator used to translate high-level code into machine code?

A

-Compilers.
-Interpreters.

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

What is a compiler?

A

-Translates all of the source code at the same time and creates one executable file.
-Only needed once to create the executable file.
-Returns a list of errors for the entire program once compiling is complete.
-Once compiled, the program runs quickly but compiling can take a long time.

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

What is an interpreter?

A

-Translates and runs the source code 1 instruction at a time but doesn’t create an executable file.
-Needed every time you want to run the program.
-The interpreter will return the first error it finds and then stop, which is useful for debugging.
-Programs will run more slowly because the code is being translated as the program is running.

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

Which type of translator will be used when translating a high-level language into machine code?

A

Dependent on the programming language and IDE being used.

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

What is a linker?

A

Used to join all of the separate compiled codes into one executable program if the program is stored over multiple source code files.

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

How does an interpreter run the source code one instruction at a time?

A

They take each instruction in the code and call machine code subroutines within their own code to carry out that instruction.

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

What are advantages of a low-level language?

A

-Commands in machine code can be executed directly without the need for a translator as computers can understand machine code.
-You control exactly what the CPU does and how it uses memory so programs will be more memory efficient and faster.

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

What are disadvantages of a low-level language?

A

-One instruction of assembly code usually only represents one instruction of machine code.
-Usually written for one type of machine or processor and won’t work on any others.
-The programmer needs to know about the internal structure of the CPU and how it manages the memory.
-Code is very hard to read, understand + modify.

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