Paper 2 - section 6 - design, testing and IDEs Flashcards
what are the differences between high-level languages and low-level languages?
- one instruction of high-level code represents many instructions of machine code, whereas one instruction of assembly code usually only represents one instruction of machine code
- high-level code will work for many different machines and processors, whereas low-level code is usually written for one type of machine or processor and won’t work on any others
- in a low-level language the programmer needs to know about the internal structure of the CPU and how it manages the memory, whereas in a high-level language you can easily store data in many different structures without fully understanding them
- high level code is easy to read, understand and modify, whereas low-level code is very difficult to read, understand and modify
- high-level code must be translated into machine code before a computer is able to understand it, whereas commands in machine code can be executed directly without the need for a translator
- in high level languages you don’t have much control over what the CPU actually does so programs will be less memory efficient and slower, whereas in low-level languages you control exactly what the CPU does and how it uses memory so programs will be more memory-efficient and faster
are high or low level languages easier for the computer to run?
low-level languages
are high or low level languages easier for humans to write?
high-level languages
give two examples of low-level languages
machine code and assembly languages
give three examples of high-level languages
python, C++ and Java
why are translators needed?
computers only understand instructions given to them as machine code, so high level languages and assembly languages need to be translated before a computer is able to execute the instructions
what are the three types of translator?
assemblers, compilers and interpreters
what are assemblers used for?
assemblers are used to turn assembly language into machine code. There are many different assembly languages (to support different CPU types) and each one needs its own unique assembler
what are compilers and interpreters used for?
to turn high-level code into machine code
what are the key features of compilers?
- 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
what are the key features of interpreters?
- translate and run the source code one 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 - this is useful for debugging
- programs will run more slowly because the code is being translated as the program is running
which type of translator produces one executable file?
compiler
what does the type of translator used depend on?
which programming language and IDE you’re using
what happens if a program is stored over multiple source code files?
a linker is used to join all of the separate compiled codes into one executable program
what is an integrated development environment?
a piece of software that provides features to help a programmer develop their program
what is the code editor?
the main part of an IDE, it’s where the code is written.
what are some common features of a code editor?
Most code editors will have line numbering and auto-colour coding for things like strings, functions, variables and comments. Good code editors will also have other automatic features like auto-correct, auto-indentation and auto-complete
what are 10 common features of an IDE?
- the code editor
- a run-time environment
- an explorer window
- an output window
- features to keep track of the line number and character number that you’re working on
- error diagnostics and debugging tools
- breakpoints
- a translator
- auto-documentation
- a graphical user interface (GUI) builder
what does a run-time environment do?
it allows the code to be run quickly within the IDE - this is done using a start or run button. The run-time environment can also help to identify logic errors in the program as the programmer can see which part of the code is running when errors occur
what is the point of an explorer window?
it helps you navigate through programs
what is the output window for?
it’s to show the output from a program when it is run
what do error diagnostic and debugging tools do?
they help to find and fix errors in a program - they’ll tell you the location of the error and often suggest ways to fix it
what are breakpoints?
a common debugging tool: they stop the program on certain lines so you can gather information like the value of variables as the program is running
what does auto-documentation help with?
the maintenance of programs. It can extract certain features of a program, like the names of variables, names of sub-programs and comments. This information is stored in a separate document to give a summary of what the code does