Is Object Orientated always the best idea?


#1

Here are some examples …


#2

Bit too much of this…

With the first example, it’s impossible to say if he’s making a valid point because the problem description exists solely inside his head. Adding the requirement that configuration be obtained from multiple sources including a YAML file and that the download be first attempted via FTP then, if that fails, via HTTP would make an object oriented solution significantly more palatable.

I have a personal objection to his criticism of the example at 11:00. I’ve dramatically simplified extremely complex state machines using that basic structure. By ignoring how that structure grows in comparison to his proposed solution is a huge disservice to his audience.

And, this applies…

From what I can tell, (some of) the other authors are teaching basic structures of object orientated programming. With “basic structure” and a beginner audience comes “over simplified” in the hopes the audience can grasp the idea.

His criticism is leveled not at the techniques or how they become programming-in-the large but at the specific over simplified examples. He ignores the intent and focuses on the specific example. Which technically makes him correct. But is also a huge disservice to his audience.

It’s no different than me climbing out of a three foot mud hole with my lifted 4x4 then announcing to the world that my vehicle is far superior to those worthless Porsche 959s. In the context of driving through a deep mud hole my claim is accurate. But, my ignoring all the rest of time and space just so I can make my claim makes me essentially a nasty liar.


#3

FYI: He goes into why much deeper in this first video


#4

I think he has some interesting points about encapsulation breaking down.


#5

Obviously, OOP is not going to be the ultimate idea. I learned 7 different programming languages …ALL were supposed to be the best ever… all are obsolete… UNIX came along and was going to be the last language ever. Its still around but I haven’t seen a UNIX based machine since I repaired some for NASA in the 90s. (I’m sure someone knows of one somewhere. So let OOPs have their day. I am too cynical with age to believe that we will ever find the best and greatest anything.


#6

I’d like to point out that Unix or a derivative flavor of it is the most successful OS and that bash is the most ubiquitous programming language out there.

Which while bash itself is not OOP out of the box it can be extended to be such:

Now don’t get me wrong, I totally agree that a OOP language is not always the best case. For example an ORM is good to model data but I wouldn’t want to use OOP to do hugely complex SQL queries and MapReduce functions. Nor would I ever use OOP to design hardware drivers or things that are close to the bare metal.

But there are times when it makes sense too. Especially in long lived projects that has to
integration points with many different systems or in highly complex interact.

A good example of this is seen in Pyeve which is built on top of flask and cerberus. While the internals of the stack are abstracted away to the point of one only needs to create a json file for the data schema and a docker-compose.yml file to stand up the stack. Through in swagger and admin-on-rest all of which are built on top of object oriented programming and the net results is a full fledged production grade system can be built, deployed and brought to market in hours.


#7

As always, it depends on what you are trying to do.

In a previous life, I worked on a project incorporating a vector graphics editor. OOP would have made our code smaller and better.

On the other hand, I hear about projects in which everything is an object with unnecessarily complex inheritances, leading to code bloat and poor performance.


#8

Exactly.

We even have Reactive programming design these days too which has its good points.