YEAR 2 CO1 WEEK 1 PROGRAMMING PARADIGMS Flashcards
What is a programming paradigm?
A style/”way” of programming where each style has many different languages.
Describe a Low Level Language.
A low level language one whose programming statements are geared towards a particular CPU.
Almost machine code (binary).
Chip makers provide low level language which to code their CPU.
State some features of a Low Level Language.
Are CPU specific using direct use of internal registers.
Code uses Mnemonic such as MOV or DIV.
Labels used as reference points to allow the code to jump from one part to another.
Many different memory modes can be used.
State some pros for a Low Level Language.
Low level language excellent for close control of the CPU.
Can be very efficient. Well optimised code written in Low Level Language.
State some cons for a Low Level Language.
Low level language produce least portable source code.
A good assembly language programmer needs to know a lot of details about internal structure of the CPU.
Difficult to use as the programming commands can be quite obscure.
Describe Procedural Languages.
Used to create specific instructions for computer to carry.
State some characteristics of a Proedural Language.
Sometimes called imperative languages. Means telling the computer what to do step by step.
All imperative languages lay out instructions in sequence.
Easier for people to read and understand code as uses named variables and using functions/subroutines.
State the pros to a Procedural Language.
Excellent for general purpose coding.
Good for set tasks to be completed in a specific way.
Good level of control without having to know precise CPU details.
Portable source code.
State the cons to Procedural Langauge.
So many procedural languages, programmers tend to specialise in one particular language to get work.
Need precise knowledge about programming instructions.
Not as efficient as hand crafted source code written in low level language.
Describe Object Orientated Languages.
Makes use of the idea of classes + objects manipulated through internal methods.
Main idea to gather data and all methods that act upon that data into one entity called a class making data hiding,code re use and maintenence much easier.
State features of Object Orientated Languages.
Features inheritance.
Data stored in attributes.
Programs structured into classes methods and instances.
Data concealed from other parts of the program (encapsulation).
State the pros for OOP
Easier to provide working code. A class can be fully tested and released in the team to use. Can reuse classes.
Treated as ‘black boxes’ so don’t need to know how they work just how to manipulate it through its methods.
Code portability.
State cons for OOP.
Steep learning curve.
Complex, need skills to craft efficient and flexible classes.
Not as compact and efficient as writing code directly in a low level language.