Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>C++ is not a typical object oriented language. </p> <p>Don't believe me? look at the STL, way more templates than objects.</p> <p>It's almost impossible to use Java/C# ways of writing object oriented code; it simply doesn't work.</p> <ul> <li>In Java/C# programming, there's alot of <code>new</code>ing, lots of utility objects that implement some single cohesive functionality.</li> <li>In C++, any object <code>new</code>ed must be deleted, but there's always the problem of who owns the object</li> <li>As a result, objects tend to be created on the stack</li> <li>But when you do that, you have to copy them around all the time if you're going to pass them around to other functions/objects, thus wasting a lot of performance that is said to be achieved with the unmanaged environment of C++</li> <li>Upon realizing that, you have to think about other ways of organizing your code</li> <li>You might end up doing things the procedural way, or using metaprogramming idioms like smart pointers</li> <li>At this point, you've realized that OO in C++ cannot be used the same way as it is used in Java/C#</li> </ul> <p><a href="http://en.wikipedia.org/wiki/Q.E.D." rel="nofollow noreferrer">Q.E.D.</a></p> <p>If you insist on doing oop with pointers, you'll usually have large (gigantic!) classes, with clearly defined ownership relationships between objects to avoid memory leaks. And then even if you do that, you're already too far from the Java/C# idiom of oop. </p> <blockquote> <p><em>Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind.</em><br> -- <a href="http://video.google.com/videoplay?docid=-2950949730059754521" rel="nofollow noreferrer">Alan Kay</a> (click the link, it's a video, the quote is at 10:33)</p> </blockquote> <p><em>Although from a purist point of view (e.g. Alan Kay), even Java and C# fall short of true oop</em></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