2.5 Programming languages Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Need for programming languages

A

-An instruction inside a CPU is in the form of binary numbers.
-people tend to find writing instructions as pure binary numbers impossible
-therefore, more people friendly computer languages have been developed

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

Types of programming languages

A

Low level:
-machine code
-assembly code

-high level language (source code)

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

Translators

A

-Tools used to convert source code into machine code (object code)
-3 types:
-assemblers
-compilers
-interpreters

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

Machine code

A

-binary code
-All programs need to be translated into machine code before a computer can understand and execute them.

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

Assembly language

A

-used to write programs that relate to the specific architecture and hardware of a particular type of computer.
-close to binary - hard to understand
-contains few words but a lot of mnemonic code

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

Advantages of assembly language

A

-Can make use of special hardware or special machine-dependent instructions (e.g. on the specific chip)
-Translated program requires less memory
-Write code that can be executed faster
-Total control over the code
-Can work directly on memory locations

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

High level language

A

-developed in order to make programming a lot easier for humans, compared to coding in assembly language
-set of keywords (e.g. PRINT or IF)
-has a set of grammar rules (syntax) which define how to combine them correctly
-e.g. Python, Java, C++, C

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

Advantages of high level language

A

-Portable code – not designed to run on just one type of machine
English like statements:
-Easier/faster to write code
-Easier to debug during development
-Easier to modify

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

Disadvantages of high level language

A

-slower due to translation
-less memory efficient
-doesn’t communicate with hardware directly
-less flexible

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

Compiler

A

-translate a program from a high level language to machine code
-Once compiled the translated file can be directly used by the computer and is independently executable (used again and again without need for recompilation)
-may be slow, but translated program will run quick
-An error report is often produced after the full program has been translated - may cause computer to crash
-errors can only be fixed by changing the original source code and compiling the program again.

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

Interpreter

A

-able to read, translate and execute one statement at a time from a high-level language program
-stops when a line of code is reached that contains an error.
-often used during the development of a program - make debugging easier as each line of code is analysed and checked before execution.
-Interpreted programs will launch immediately, but may run slower then a complied file.
-No executable file is produced. The program is interpreted again from scratch every time you launch it.

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

Assembler

A

-used to translate a program written in a low-level assembly language into a machine code (object code) file so it can be used and executed by the computer
-Once assembled, the program file can be used again and again without re-assembly

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

IDE

A

Integrated Development Environment
-set of tools which help and aid you in writing computer programs

-debugging tools for finding logic errors
-help with preventing and identifying syntax errors
-providing a run time environment
-usability functions

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

IDE - debugging tools for finding logic errors

A

-Breakpoints – stopping a program at a line of code during execution
-Stepping through lines of code one at a time to check which lines are executing
-Tracing through a program to output the values of variables

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

IDE - help with preventing and identifying syntax errors

A

-Illustrating keyword syntax and auto-completing command entry
-Error highlighting
-The compiler produces an output of the error message to help identify it

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

IDE - providing a run time environment

A

-Output window
-Simulating different devices the program can run on

17
Q

IDE - usability functions

A

-Navigation, showing/hiding sections of code
-Formatting source code
-Find and replace
-Comment or indent regions.