Paradigms

20 0 0
                                        


Procedural Programming

Programming paradigm- an approach to programming e.g. procedural, object-oriented, functional, etc.

Procedural Programming- a language which sees programs developed around procedures/functions and utilising variables including variable scope (global and local)

The features of procedural programming are:

-uses procedures/functions/routines which can be called from anywhere;

-uses variables which can have global/local scope;

-uses constants;

-uses arithmetic and calculations;

-uses logic - program works in a step-by-step way, obeying instructions;

-supports the re-usability of code; and

-is based on imperative, so uses constructs: sequence, selection and iteration.


Object Orientated Programming (OOP)

Glossary:

-OOP models the real world more closely through the use of objects

-Object- based on a class which is a blueprint for the object, and defines the object's attributes and methods

-Attribute- data associated with the class

-Method- functionality of the class (like a sub-routine)

-Constructor- special type of method, creates an instance of the class, so creates a new objects

-Encapsulation- attributes in a class are private, but they can be accessed through their methods (information hiding)

-This means multiple programmers can work on multiple classes without them interfering. They also don't need to know how different classes are implemented (they are ADTs)

-Inheritance- a new class, related to a base (parent) class, is able to inherit the attributes and methods of the parent class and can have its own methods and attributes and/or override the attributes and methods of the parent class

-Polymorphism (many forms)- a super class might have methods that need to be overridden in a subclass, as it is different data, so the same operation might need a different behaviour

Computer Science Reviews (A level)Where stories live. Discover now