[Main website]

feature/oop

OOP has many merits:

  • hierarchical data, like nested data structures
  • interfaces like ad-hoc (type) polymorphism and mathematical classes
  • code reuse using inheritance

OOP can have not so much nice features like:

  • sub types and inheritance sometime does not make sense
  • some “is-a” hierarchies sometime does not make sense from a logical point of view

In Dok probably I can use OOP for:

  • nested data structures like (def-data /Tree (/Branch /Leaf))
  • slots associated to an object
  • interface/class support of a protocol

In Dok, probably I will not use OOP for inheritance implying subtypes.

In Dok probably I will not use OOP for creating a system of cooperating objects, but I will use different paradigms, accordingparadigm/runtime-oriented-programming

In Pharo and Smalltalk, OOP is very powerful because: everything is an object; metaprogramming using OOP. But it can create also obscure code because every part of an OOP application can be hidden in class, metaclass and similar customizations.

Links to this note