Brief Evolution of Functional and Object Oriented Programming Paradigms
Learning and Creating Software, to many developers, is one of the most exciting experiences. This is because it keeps us on our toes.
Things are changing very fast. There is always that language to learn. Or that library. Or that API.
This has to be since the fundamental problems in Sofware Development have not been solved. The best practices, the processes involved as well as the tools used are always evolving.
Languages are coming and going. The same to libraries. The same to paradigms.
Structural Programming with
C language was the dominant paradigm after
C's introduction in the
C with Classes or
C++, became dominant after adding Object Orientation features in
Throughout the late
1990s, ask a programmer the hottest thing then and the answer was Objects.
But over the course of the last decade complexity in software has grown immensely, even with the devices being more powerful than ever.
Users expect more powerful and responsive apps.And programmers expect a wider palette to express their ideas than just objects.
So experienced programmers and language designers have been glancing over at functional programming, borrowing features and techniques over there.
In Object Oriented Programming, we think of our program in terms of Objects. Objects have objective features like data and behavior. And these objects interact with each other.
These objects maintain their own state.
On the other hand, with Functional Programming, we think of our program in terms of functions. And these functions act on arguments.
Functional Programs are modeled on mathematical functions. The inputs you enter on the program get treated as the arguments to functions.
These functions like mathematical functions, are stateless. So they always return the same values and have no side effects. A function may be defined in terms of other functions, and those functions may in turn be defined in terms of other functions and so on. But ultimately your program is a single-function application, as opposed to a series of executive commands.
Functional Programming is not new. But it's appreciation has sky-rocketted in the 21st century. This is because programmers have realised that some problems are better solved through functional programming than object orientation.
Furthermore 21st century development techniques like Test-Driven Development melds well with Functional Programming. But the number one reason for it's growth has been it's natural suitability and relative ease when creating distributed and highly concurrent systems.
However, instead of a pure functional programming language rising to the scene, object oriented languages have been incorporating functional techniques and features to have more hybrid languages.
Such that we can work with functions just like functions in functional programming languages, yet those functions can have state like objects in object oriented languages.