Interactive PowerBasic Forum

General Category => Contentious discussions about anything, the world, politics and health topics. => Topic started by: Theo Gottwald on September 03, 2023, 02:58:18 PM

Title: Why Object oriented Programming is not what you might think.
Post by: Theo Gottwald on September 03, 2023, 02:58:18 PM
The Object-Oriented Paradigm: A Critical Examination in the Spirit of Algorithmic Analysis

The world of computer science has been profoundly influenced by the advent of the Object-Oriented Programming (OOP) paradigm. It has been hailed as a panacea for software engineering woes, a silver bullet that promises modularity, reusability, and a host of other virtues. However, as we delve into the intricacies of algorithms and computational complexity, one must pause and critically examine the efficacy of this paradigm.

The Abstraction Conundrum
OOP encourages abstraction, often to a fault. While abstraction is a powerful tool, it can also obfuscate the underlying algorithmic complexity. In the quest for creating 'objects' and 'methods,' we may inadvertently introduce inefficiencies that are hard to detect but have a significant impact on performance.

The Inheritance Quagmire
Inheritance, a cornerstone of OOP, is a double-edged sword. While it allows for code reusability, it can also lead to a tangled web of dependencies. This hierarchical structure often makes it difficult to reason about the program's behavior, especially when multiple inheritance comes into play.

Encapsulation: A Mixed Blessing
Encapsulation, another pillar of OOP, aims to bundle data and methods that operate on that data within a single unit. While this is laudable from a design perspective, it can also lead to data structures that are not as efficient as they could be if designed from a more algorithmic standpoint.

Polymorphism and the Loss of Type Safety
Polymorphism allows objects to be treated as instances of their parent class, leading to more generic and reusable code. However, this comes at the cost of type safety and can introduce subtle bugs that are hard to detect and even harder to debug.


The Procedural Alternative
Let us not forget that before the rise of OOP, procedural programming was the dominant paradigm. It allowed for a more straightforward analysis of algorithms, focusing on the actions rather than the data. While it may lack the modularity that OOP offers, it provides a level of clarity and performance that is often sacrificed in object-oriented design.

Concluding Remarks
Object-Oriented Programming is not without its merits. It has its place in the toolbox of a skilled programmer. However, it should not be viewed as the end-all, be-all solution to every computational problem. As we strive for algorithmic efficiency and clarity, let us not be blinded by the allure of objects and methods. Instead, let us adopt a more holistic approach, one that considers the algorithmic implications of our design choices.


In the words of E.W. Dijkstra, "Object-oriented programming is an exceptionally bad idea which could only have originated in California." While this may be an extreme view, it serves as a reminder that we should not embrace paradigms uncritically. Let us continue to scrutinize, analyze, and, most importantly, understand the tools at our disposal.




Title: Re: Why Object oriented Programming is not what you might think.
Post by: Charles Pegge on September 05, 2023, 11:52:28 AM
Conceptually speaking, Windows is a deeply OOP system. Anything with a handle is an object, and the message processing system completes the original OOP paradigm, where objects only communicate by passing messages to each other.
Title: Re: Why Object oriented Programming is not what you might think.
Post by: Theo Gottwald on September 06, 2023, 06:03:38 AM
An real object would run as an own thread (having its own life).
I tried to explain this to Powerbasic and Bob Zale long time ago, but i failed,
as a result they implemented that faulty and buggy Thread Object.