Saturday, September 28, 2019

Programming Paradigms - Java 8 Enhancement

A programming paradigm is a way of thinking and seeing the world when it comes to programming. It borrows the Thomas Kuhn definition of paradigm and just applies it to the practice of programming.

The four main programming paradigms (according to Wikipedia) are: imperative, functional, object-oriented, and logic. Although object-oriented is pretty self explanatory, I won’t go into it nor will I discuss logic programming.


Object-oriented languages are good when you have a fixed set of operations on things and as your code evolves, you primarily add new things. This can be accomplished by adding new classes which implement existing methods and the existing classes are left alone.

Functional languages are good when you have a fixed set of things and as your code evolves, you primarily add new operations on existing things. This can be accomplished by adding new functions which compute with existing data types and the existing functions are left alone.

No comments:

Post a Comment