Please enable JavaScript.
Coggle requires JavaScript to display documents.
2.5 Programming languages and IDEs - Coggle Diagram
2.5 Programming languages and IDEs
Translators
Types of translators
High-level source code translators
Compiler
The whole program is translated into machine code before it is run
Advantages
Speed of execution is faster
Code is usually optimised
Original source code is kept secret
No need for translation software at run-time
Translates source code from high level languages into object code and then into machine code ready to be processed by the CPU
Disadvantages
Code needs to be recompiled when the code is changed
Designed for a specific type of processor
Source code is easier to write in a high-level language, but the program will not run with syntax errors, which can make it more difficult to write the code
Interpreter
Translates source code from high level languages into machine code ready to be processed by the CPU
The program is translated line by line as the program is running
Advantages
Code does not need to be recompiled when code is changed, and it is easy to try out commands when the program has paused after finding an error
This makes interpreted languages very easy for beginner programmers to learn to write code
Easy to write source code because the program will always run, stopping when it finds a syntax error
Disadvantages
Speed of execution is slower
Code is not optimised
Translation software is needed at run-time
Source code is needed
Purpose
High level and low level languages
Machine code
Binary representation of instructions in a format that the CPU can decode and execute
Have an operation code (opcode) instruction and address or data to use (operand)
Low level languages
Written in Assembly langugage
Translated by an assembler into machine code
Used for embedded systems and device drivers where instructing the hardware directly is necessary
One instruction translated into one machine code instruction
The code works on one type of processor only
The programmer works with memory directly
Code is harder to write and understand
Memory efficient
Code is fast to execute
High level languages
One source code instruction translates to many machine code instructions
Code will run on different types of processors
Makes the writing of computer programs easier by using commands that are like English
The programmer has lots of data structures to use
Translated by a compiler or interpreter into machine code
Code is quicker and easier to understand and write
Source code is written in languages such as Python, C++, Java, Visual Basic
Less memory efficient
Code can be slower to execute if it is not optimised
Integrated Development Environments
IDE's provide the following functions:
Help with preventing and identifying syntax errors
Error highlighting
The compiler produces an output of the error message to help identify it
Illustrating keyword syntax and auto-completing command entry
Providing a run time environment
Output window
Simulating different devices the program can run on
Debugging tools for finding logic errors
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
Breakpoints - stopping a program at a line of code during execution
Usability functions
Formatting source code
Find and replace
Navigation, showing/hiding sections of code
Comment or indent regions