this post was submitted on 02 Feb 2024
0 points (NaN% liked)

Programming

24318 readers
260 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

There are so many definitions of OOP out there, varying between different books, documentation and articles.

What really defines OOP?

top 7 comments
sorted by: hot top controversial new old
[–] Kache@lemm.ee 1 points 2 years ago* (last edited 2 years ago)

You're getting a lot of conceptual definitions, but mechanically, it's just:

keeping state (data) and behavior (functions) that operate on that state, together

At minimum, that's it. All the other things (encapsulation, message passing, inheritance, etc) are for solidifying that concept further or for extending the paradigm with features.

For example, you can express OOP semantics without OOP syntax:

foo_dict.add(key, val)  # OOP syntax

dict_add(foo_dict, key, val)  # OOP semantics
[–] porgamrer@programming.dev 1 points 2 years ago* (last edited 2 years ago)

It's similar to any tech buzzword. Take "agile" for example. Agile was successfully sold as being a great idea without really being well-defined. Suddenly anyone selling a development methodology had a strong incentive to pitch it as being the real way to do agile development.

In the 90s and 2000s every 10x california tech guru agreed that OO was the future, but apparently none of them actually liked smalltalk. Instead, every new language with a hint of dynamic dispatch suddenly claimed to represent the truest virtues of OO.

There are also people who argue that smalltalk is not true OO. They say that by Alan Kay's own definition the most OO language is Erlang.

I think it's most useful to learn about that history, instead of worrying about people's post-hoc academic definitions.

[–] rikudou@lemmings.world 1 points 2 years ago

OOP on its most fundamental level is the principle that stuff is represented by objects and those objects communicate with each other. That's it, that's the whole OOP.

What you are probably referring to is how OOP solves different problems and the different patterns it uses. Those are not OOP itself, those are basically instructions on how to do OOP correctly without shooting yourself in the foot.

So SOLID, IoC, dependency injection, factory, composition over inheritance and all the other famous principles are not OOP itself, but any medium-size app that's not following them is set for really fun times ~5 years down the road.

Not sure if I've answered your question, it's really vague, feel free to ask further.

[–] maynarkh@feddit.nl 0 points 2 years ago (1 children)

Dude, you're going to shit bricks when you realize most computer science jargon is just marketing buzzwords on top of marketing buzzwords and the terms never meant anything more or less it needed to sell a product.

For example, what the hell is big data? What is a scripting language? Is your DB web scale?

[–] MajorHavoc@programming.dev 0 points 2 years ago (1 children)

For example, what the hell is big data?

Big data is when we align our agile synergies at scale.

[–] madcaesar@lemmy.world 0 points 2 years ago (1 children)
[–] maynarkh@feddit.nl 1 points 2 years ago

That one phrase does mean something though, and it should be fucking illegal.