Types Of Programming Language Flashcards
Programming paradigm
Different approaches to using a programming language to solve a problem
(To describe an example of a way of doing things)
Turing complete language
Can solve all the problems that a computer is able to solve
What is the need for different programming paradigms
We need different programming paradigms because some problems are better suited to being solved using a certain paradigm
Machine code
Least abstract
Closest to what actually happens on a computer
These translate into matching electrical signals
Programs directly into 1’s and 0’s
Assembly language
Uses short code words (mnemonics)
Each mnemonic matches a specific sequence of 1’s and 0’s
Written in assembly language and translated by a specific assembler
One to one relationship
High level languages
The first languages that could go further than machine code and assembly language were developed in the early 1950s
These languages had a one to one relationship as each instruction could translate to many lines of machine code
Imperative languages
Use statements that change a programs state in the form of sequence, selection, iteration. Consists of commands for a computer to perform and focus on describing how a program operates
Declarative languages
Focus on what the program SHOULD accomplish
Sublevel of high level languages
Declarative
Imperative
Types of imperative
Object oriented
Procedural
Type of declarative
Logic
Functional
Object oriented
Modern extension of the imperative programming approach that focuses more on a modular approach to programming
Procedural
Type of imperative programming paradigm where a program is built from one or more subroutines
Advantages of machine code and assembly language
Assembly language has the same efficiency of execution as machine code due to its one to one nature
It can produce very precise, locally optimised and efficient code
It provides direct access to system level features without having to go through a software interface- this improves the speed of the program
In complete control of your code
Disadvantages of machine code and assembly language
It is machine dependant and code is very hard- if not impossible - to port
programmers who can write efficient assembly code are rare- which is one of the reasons why high level languages were produced in the first place
Even in the hands of a talented programmer code can be tedious to write and very prone to bugs
The code can be difficult to understand therefore it can also be hard to modify and maintain
Features of procedural programming paradigms
Sequence, selection, iteration
procedural programming paradigms data
Stored in local and global variables and accessible to other parts of the program using parameter passing
procedural programming paradigms structure
Procedures and function
procedural programming paradigms logic
Expressed in a series of procedure calls
Features of object oriented paradigms
Sequence, selection, iteration plus inheritance, objects, classes and encapsulation
object oriented paradigms data
Stored in attributes and concealed from other parts of the program via encapsulation
object oriented paradigms structure
Classes, methods and instances
object oriented paradigms logic
Based on models and behaviours
Procedural language programming features
Variables
Constants
Selection
Iteration
Sequence
Subroutines
String handling
File handling
Operators
Arrays