Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not directly an answer to your question, but I'd like to point out that "object-oriented" and functional programming aren't necessarily at odds. The "core concepts" you cite have more general counterparts which apply just as well to functional programming.</p> <p>Encapsulation, more generally, is modularisation. All purely functional languages that I know of support <strong>modular programming</strong>. You might say that those languages implement encapsulation better than the typical "OO" variety, since side-effects break encapsulation, and <strong>pure functions have no side-effects</strong>.</p> <p>Inheritance, more generally, is <strong>logical implication</strong>, which is what a function represents. The canonical <code>subclass -&gt; superclass</code> relation is a kind of implicit function. In functional languages, this is expressed with <strong>type classes</strong> or <strong>implicits</strong> (I consider implicits to be the more general of these two).</p> <p>Polymorphism in the "OO" school is achieved by means of subtyping (inheritance). There is a more general kind of polymorphism known as <strong>parametric polymorphism</strong> (a.k.a. generics), which you will find to be supported by pure-functional programming languages. Additionally, some support "higher kinds", or higher-order generics (a.k.a. <em>type constructor polymorphism</em>).</p> <p>What I'm trying to say is that your "core concepts of OO" aren't specific to OO in any way. I, for one, would argue that there aren't <em>any</em> core concepts of OO, in fact.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload