2.5

Cards (23)

  • Machine code is a series of numbers, written in either binary or hexadecimal.
  • The instructions that tell a computer what to do are written in machine code.
  • High level programming languages are languages that are close to the spoken and written language of the programmer.
  • Programmers find machine code difficult to learn, program in and debug. As a result, the majority of programmers write programs in high level programming languages.
  • Programmers write in high level languages because they are easier to understand and are less complex than machine code.
  • High level languages are restricted to the number of statements built into them.
    If the programmer wants a program to do something, but a statement does not exist to do so, the task cannot be done.
  • Any program written in a high level language is known as source code.
  • Source code must be translated into machine code before the computer can understand and execute it.
  • Low level languages are languages that sit close to the computer's instruction set.
  • Writing in machine code allows programmers to do things that might not be possible in a high level language.
  • Machine code is notoriously difficult to write in, understand and debug, simply because it consists of either binary or hexadecimal numbers.
  • Assembly language sits between machine code and high level language. While high level languages use statements to form instructions, assembly language uses mnemonics.
  • A compiler takes the source code as a whole and translates it into object code all in one go.
  • Advantages of compilers
    • Compiled programs run quickly, since they have already been translated.
    • A compiled program can be supplied as an executable file. Since an executable file cannot be easily modified, programmers prefer to supply executables rather than source code.
    • Compilers optimise code. Optimised code can run quicker and take up less memory space.
  • Disadvantages of compilers
    • Because the source code is translated as a whole, there must be enough memory space to hold the source code, the compiler and the generated object code.
    • Compilers do not usually spot errors.
    • The source code must be re-compiled every time the programmer changes the program.
  • An interpreter translates source code into object code one instruction at a time.
  • Advantages of interpreters
    • Instructions are executed as soon as they are translated.
    • Since instructions are executed once translated, they are not stored for later use. Interpreters require less available memory.
    • Errors can be quickly spotted - once an error is found, the program stops running.
  • Disadvantages of interpreters
    • Interpreted programs run more slowly as the processor has to wait for each instruction to be translated before it can be executed.
    • Additionally, the program has to be translated every time it is run.
    • Interpreters do not produce an executable file that can be distributed. This could be modified without permission.
  •  An executable file is a file that is ready to run. An executable file cannot be easily modified.
  • Editors are software which allow programmers to write and edit code.
  • Editors have special tools. These help to improve the readability of code.
  • IDEs usually contain error diagnostics which will highlight syntax errors in real time as you program.
  • The run-time environment allows you to run programs to test how well they work.