top | item 47069888

(no title)

anonymars | 11 days ago

I think you are both unknowingly talking past each other: my understanding is that Smalltalk-style "object-oriented programming" ("everything is a message!") is quite distinct from C++/C#/Java/Rust "object-oriented programming" ("my structs have methods!")

discuss

order

9rx|10 days ago

Right, the former is what OOP is. The latter, encapsulating data in "objects", is functional programming.

anonymars|10 days ago

They are both OOP, just as a "football" can be either spherical or oblong.

Functional programming is not "encapsulating data in 'objects'". Such a model would naturally feature methods like "void Die.roll()", "void list.Add(element)" which are definitely not functional programming (which emphasizes immutability, pure functions, composition, etc.)