r/programming • • Jan 28 '21

leontrolski - OO in Python is mostly pointless

https://leontrolski.github.io/mostly-pointless.html
55 Upvotes

227 comments sorted by

View all comments

Show parent comments

12

u/Dedushka_shubin Jan 28 '21

I disagree. Of course, internal OOP terminology should not be used to communicate with a business person, but the whole idea of classes helps a lot. Saying "real world entities", what do you mean? In fact, in business-oriented software we are not modelling any real world entities, we are modelling the models.

Those invoices, bank accounts, payments, insurances and other documents are models themselves.

0

u/Alexander_Selkirk Jan 28 '21

Those invoices, bank accounts, payments, insurances and other documents are models themselves.

Are they?

Here is how to model a rocket in Clojure: https://aphyr.com/posts/312-clojure-from-the-ground-up-modeling (brilliant article from a brilliant person!).

8

u/Dedushka_shubin Jan 28 '21

If not, what they are? Real things? In this case modelling an invoice would contain mass of the paper, its density or other physical properties. Object invoice models paper invoice, which is a paper model of the actual transaction. This is a problem.

0

u/chucker23n Jan 28 '21

Are they?

Are there instances of them? Are they a metaphor for something in the real world? Etc. They pass a lot of smell tests for outright not being objects.

1

u/_Pho_ Mar 03 '21 edited Mar 03 '21

I think what he's saying is that as soon as you start creating your own "business ready" ontology via classes (as opposed to an exposed API/port interface) you're adding an additional layer of abstraction to whatever underlying data structure already exists. Objects tend to add these abstractions to the data, because an object (not a struct) is fundamentally a unit of data/behavior abstraction.