Quantcast
Channel: coolbean's timeline
Viewing all articles
Browse latest Browse all 2434

@solonovamax this is slightly complicated cause yea, objects serve 2 purposesan object controls v...

$
0
0

@solonovamax this is slightly complicated cause yea, objects serve 2 purposes

an object controls visibility of its internals. this is the part covered by modules having defined interfaces (confusingly some also call that encapsulation)

an object also holds data and code in an easy to access manner. this can be covered by… any sufficiently fancy struct (fun fact: in c++ the only differences between structs and a classes are that struct members aren’t private by default and cant be inherited from other structs/classes)

so, a struct inside of a (sub)module? that’s pretty much an object (without inheritance and the weird terminology cause thats the only unique OOP parts)


Viewing all articles
Browse latest Browse all 2434

Trending Articles