Low Level Language
A language that is close to what a CPU would actually do and written for specific hardware
Examples of low level language
machine code
assemble language
Machine Code
the lowest level programming language consisting of 0s and 1s. CPUs can directly process it as a string of CPU instructions. 1st generation
pros of machine code
more flexibility with commands
commands can be directly executed without a translator
faster to process as CPU doesn’t have to translate
more memory efficient
cons of machine code
usually written for 1 type of machine or processor- wont work on others
very hard for programmers to read and understand
programmer requires knowledge of internal structure of CPU
Assembly Language
2nd generation language that uses mnemonics to form instructions. Each mnemonic corresponds with a machine code instruction.
pros of assembly language
much easier to read and understand that machine code
more accessible to programmers
cons of assembly language
not as easy to use as high level languages
requires translation
requires an assembler
high level languages
3rd gen programming languages that are easy for humans to understand
examples of high level languages
python
java
C++
pros of high level languages
one instruction of high level=many instructions of machine code
portable- same code works for many different machines and processers
easy for programmer to store data (e.g. in arrays) without knowledge of memory structure
code is close to english so is easy to read and understand
cons of high level languages
must be translated for computer to understand
programs are less memory efficient and slower to execute
translator
a program that allows source code to be understood and executed by the computer
types of translator
compiler
interpreter
compiler
type of translator that translates all of the source code at once and creates one executable file
pros of compiler
only required once to create executable file
returns a list of errors for the entire program once compiling is complete
once compiled program runs quickly
cons of compiler
compiling can take a long time, so program isn’t immediately executed
not good for debugging
interpreter
translates and runs the source code of one instruction at a time
pros of interpreters
will return first error it finds and then stop-good for debugging
more immediate execution of the program
cons of interpreters
doesn’t create an executable file
needed every time you want to run the program
programs will run more slowly
IDE
Integrated Development Environment- A piece of software to help a programmer develop programs
features of IDEs
code editor
run-time environment
error diagnostics and debugging tools
breakpoints
translator
GUI
Code Editor
where code is written
will usually have:
line numbering
colour coding
auto-correct
auto-indentation
auto-complete
runtime environment
allows code to be run quickly within IDEs- done using start/run button.
can help identify logic errors as programmer can see which part of code is running when errors occur.
GUI
helps programmer design a user interface by building it up graphically rather than having to design it using source code.