Programming Paradigms
Unstructured programming
- Emphasis on the results of the program (the solution), without concern for how the solution is achieved.
- Spaghetti code; very difficult to maintain
- Only practical for very small, simple programs.
Procedural programming
- Emphasis on algorithmic abstractions; on processing data
- Procedures (aka functions, subroutines)
- Global scope (variables and functions available from anywhere in the program)
Modular programming
- Related functions and variables grouped together in separate files.
- File scope (variables and functions not available outside of that file)
Structured programming
- Conditional constructs (if - else)
- Looping constructs (for, while, do - while)
- Complex data structures
- Enforced relationships between data
- Nested functions
- Function arguments
- Local scope (variables and sub-functions not available outside of that function)
- Encapsulation (information hiding) (within a module)
- Modules are loosely coupled.
- Each block of code has a single entry point and a single exit point.
- Avoidance of goto statements
Functional programming
- A sequence of stateless function evaluations
- First-class functions
- Relies heavily on recursion
Abstract data types (ADT)
- A set of data items that can only be accessed by defined operations.
Object-oriented programming (OOP)
- Emphasis on the behavior and attributes of tangible or abstract entities (objects)
- Class (the behavior and attributes of a tangible or abstract entity)
- Object (an existing occurrence of a class) (aka instance)
- Interface (an abstract class that provides the behavior and attributes for a category of classes without defining the class)
- Abstraction (implementation hiding) (within a class).
- Encapsulation (information hiding) (within a class)
- Inheritance (heirarchical reuse of behavior and attributes between similar classes)
- Polymorphism (an object's behavior is based on its place in the inheritance hierarchy at run-time)
Post-object programming
Weaknesses of OOP
- Localizing concerns involving global constraints or pandemic (widespread) behaviors
- Appropriately segregating concerns
- Applying domain specific knowledge.
Possible successors to OOP
- Aspect-oriented programming (AOP)
- Domain-specific languages
- Generative programming
- Generic programming
- Constraint languages
- Reflection and metaprogramming
- Feature-oriented development
- Views/viewpoints
- Asynchronous message processing
Sources
- Design Patterns: Elements of Reusable Object-Oriented Software; Gamma, Helm, Johnson, Vlissides; 1995; Addison Wesley
- http://en.wikipedia.org
- http://eies.njit.edu/~haibin/Lesson1.ppt
- http://www.cecs.csulb.edu/~tayek/575/aop/aop.html
- http://america3.pcs.cnu.edu/~tdunn/cpsc231/oop.htm
- http://cs.hiram.edu/~guercioa/cs172/chap07-class-long
Parent URL:
category/programming