Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, the <em>ideal</em> would probably be to not need delete of any kind. Have a garbage-collected environment, let the programmer avoid the whole problem.</p> <p>The complaints in the rant seem to come down to</p> <ol> <li>"I liked the way malloc does it"</li> <li>"I don't like being forced to explicitly create objects of a known type"</li> </ol> <p>He's right about the annoying fact that you have to implement both <code>new</code> and <code>new[]</code>, but you're forced into that by Stroustrups' desire to maintain the core of C's semantics. Since you can't tell a pointer from an array, you have to tell the compiler yourself. You could fix that, but doing so would mean changing the semantics of the C part of the language radically; you could no longer make use of the identity</p> <pre><code>*(a+i) == a[i] </code></pre> <p>which would break a very large subset of all C code.</p> <p>So, you could have a language which</p> <ul> <li><p>implements a more complicated notion of an array, and eliminates the wonders of pointer arithmetic, implementing arrays with dope vectors or something similar.</p></li> <li><p>is garbage collected, so you don't need your own <code>delete</code> discipline.</p></li> </ul> <p>Which is to say, you could download Java. You could then extend that by changing the language so it</p> <ul> <li>isn't strongly typed, so type checking the <code>void *</code> upcast is eliminated, </li> </ul> <p>...but that means that you can write code that transforms a Foo into a Bar without the compiler seeing it. This would also enable ducktyping, if you want it.</p> <p>The thing is, once you've done those things, you've got Python or Ruby with a C-ish syntax.</p> <p>I've been writing C++ since Stroustrup sent out tapes of cfront 1.0; a lot of the history involved in C++ as it is now comes out of the desire to have an OO language that could fit into the C world. There were plenty of other, more satisfying, languages that came out around the same time, like Eiffel. C++ seems to have won. I suspect that it won <em>because</em> it could fit into the C world.</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. 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