1.2.4 Flashcards
programming paradigm
“An example of a way of doing things.”
turing complete language
languages that can solve all the problems that a computer is able to solve
the need for multiple programming paradigms
there are other ways of doing things (there are other programming paradigms) but some problems are better suited to being solved using a certain paradigm
characteristics of programming paradigms
we expect programming languages to include facilities like variables, loops, conditions and arrays, syntax or commands are different, but the underlying concepts haven’t changed much
low level languages
machine language
assembly language
low level languages - pros
Assembly language has the same efficiency of execution as machine code due to its one-to-one nature
can produce very precise, locally optimised and efficient code
provides direct access to system-level features without having to go through a software interface (improves the speed of the program)
you are in complete control of your code
low level languages - cons
machine-dependant, and code is very hard – if not impossible – to port.
Programmers who can write efficient assembly code are rare
Even in the hands of a talented programmer, code can be tedious to write and very prone to bugs
code can be difficult to understand, so hard to modify/maintain
machine language
Least abstract.
Closest to what actually happens on a computer.
Programs directly in 1s and 0s.
These translate into matching electrical signals – e.g., 1 for high voltage and 0 for low.
assembly language
Uses short code words known as mnemonics.
Each mnemonics matches a specific sequence of 1s and 0s.
One-to-one relationship.
Written in assembly language and translated by a specific assembler.
high level languages
imperitive
declarative
imperative language
uses statements that change a program’s state in the form of sequence, selection, iteration, etc…
consists of commands for a computer to perform and focus on describing how a program operates
procedural languages
a type of imperative programming paradigm where a program is built from one or more subroutines (procedures, functions etc)
Object-oriented programming paradigms
a modern extension of the imperative programming approach that focuses more on a modular approach to programming
declarative language
focuses on what the program should accomplish
LMC
Little Man Computer
a conceptual computer often used in education theory and exams to help students learn, test and understand assembly language
LMC - ADD
add
Add the contents of the memory address to the accumulator