Programming Languages and Integrated Development Systems (IDEs) - OCR GCSE

High Level Languages

High level languages are closer to the human language so that humans can understand them more easily. Machine code is made of a series of numbers in either binary or hexadecimal, this is hard for humans to understand so most programmers use high level languages such as python to code instead.

A limitation of high level languages is that the program is limited to the number of statements that are built in so some task cannot be done.

Known as one-to-many languages.

Commonly used high level languages: Python, Java, C++, C#, Visual Basic, JavaScript


Source code

Source code is any code that is written in high level language. It must be translated into machine code before the computer can use it.


Low Level Language

Low level languages are closer to the computer's instruction set (what the processor understands. There are two types of low level language: machine code and assembly language)


Machine code

Is not limited by the number of statements that are built into the language as it is the language that the processor understands, so there is a wider lange of things you can do with this language compared to high level languages. More difficult to program in as it is harder for humans to understand.

Advantages of machine code:

  • More versatile

  • More flexible for programmers

Disadvantages of machine code:

  • Difficult to write in and understand

  • Difficult to debug code


Assembly Language

Assembly language is in between high level languages and machine code. Uses mnemonics (abbreviations of words) in a one-to-one correspondence with machine code.

Examples of mnemonics:

  • LDA - Loads a value from a memory address

  • STA - Stores a value in a memory address

  • ADD - Adds the value held in a memory address to the value held in the accumulator

  • SUB - Subtracts from the accumulator the value held in a memory address

  • MOV - Moves the contents of one memory address to another


Mnemonics are easier for programmers to understand that machine code. Earlier to debug and quicker to write.

Little Man Computer (LMC): Simulation of basic processor. Uses assembly language with a limited set of mnemonics.


Opcodes and Operands

Machine code and assembly language instructions contain two parts:

  • Opcode - that actual instruction

  • Operand - the value that the instruction uses

Can be in either binary or hexadecimal but hexadecimal is preferred as it can represent the same thing using less characters.


Translators

Before a program written in high level language (called source code) can be run by computers it must be translated into a language that the computer can understand. (called object code)

A translator converts source code into object code. There are three types of translator: Compilers, interpreters and assemblers.


Compilers

A compiler translates source code into object code in one go. Object code can then be run unassisted at any time.

Advantages of compilers:

  • Compiled programs can be run quickly as they have already been translated

  • Compiled program can be supplied as executable file (ready to run)

  • Compilers optimise code so they take up less space in memory

Disadvantages of compilers:

  • Must be enough memory to hold the source code, the compiler and the object code generated all at the same time.

  • Compilers don’t usually spot errors, programs must be run to see where errors are.

  • Whole source code must be compiled every time the program changes.

  • Object code is specific to the processor’s architecture so compiled programs cannot run on other platforms.


Interpreters

Translates source code into object code one instruction at a time.

Advantages of interpreters:

  • Instructions are executed as soon as they are translated.

  • Requires less memory as instructions aren’t stored for later.

  • Errors can be spotted quickly and the program stops running once an error is found.

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.

  • Program has to be translated every time it is run.

  • Interpreters don’t produce an executable file.

  • Don’t optimise code.


Integrated Development Environment (IDE)

IDEs are designed to help programmers write clear and maintainable code. They include tools such as editors, run-time environments, automatic line numbering, error trapping, colour coding, breakpoints, variable, tracing, auto-correct, auto-suggestion, auto-indent and interpreters.

Brands of IDEs: 

  • Python has simple IDE called IDLE

  • Eclipse and Netbeans are used for Java, JavaScript and HTML

  • Visual Studio used for Visual Basic and C#


Editors

Software that allows programmers to write and edit code. Usually simple but do things such as: automatic line numbering, colour coding, auto-correct, auto-suggestion, auto-indent

Improve readability of code but don't identify errors.


Runtime Environments (RTE)

Allows programs to run on a computer. Works on different platforms so programs can be developed on different platforms. Creates a virtual machine (emulation of computer system) to run the program.

Common RTE is Java Runtime Environment.


Debugging Tools

Allows programmers to identify and fix errors.

  • Breakpoints - Allows the program to be stopped at a predetermined point so the programmer can examine different points of the program separately.

  • Variable tracing - Lets programmers see the value of variables changing as the program runs.

  • Some IDEs show the exact line that the syntax error is, known as error trapping.