[comp.sys.mac.programmer] MPW C++ vs. THINK C 4.0 :THE SUMMARY

gft_robert@gsbacd.uchicago.edu (08/17/90)

---------

Well, this time I got a lot of answers.  Thanks to all who gave their advice!

Since this seems to be a periodic question, and since a couple of people asked
me to forward info whome I can't reach from my node, I thought I'd summarize to
the net. 

NOTE: Since I didn't say I would be summarizing, and since people who wrote me
were writing under the assumption that it would be private e-mail, I've left
off the attributions in the following opinions.  I can't see why anyone would
mind my posting their names, but I thought in the interests of privacy I
shouldn't.  But remember: these aren't my opinions, I"m just passing them
along.

Robert

SUMMARY FOLLOWS:
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
One thing I noticed a few days ago was that THINK C will gradually add
C++ features, that it will not be a sudden thing.  So C+- may be C++-
before being C++; and it could take a while for each to happen...
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

I believe that THINK C is a subset of C++, and lacks MANY of C++'s features.
If you want to learn C++, the MPW product is the way to go.

I have no direct experience with either product; I am repeating what I
have heard on the net.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
There was an article in Byte comparing these two programs.
I'm not sure which issue (it's at home) but it was this year.
I think it might be March, April, or May of 1990.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I am familar with both C++ and THINK C 4.0, as I regularly do my
classwork using C++ but write in THINK C at work.  The differences
are driving me crazy, but here are some good reasons to get C++
to learn C++:


    1)  Operator overloading.  It seems I never knew how much
        I would like it until I tried it, but its great!

    2)  Proper syntax for initializations and creation/deletions.
        I like the way THINK does it, but C++ is still C++, not
        THINK (you said you wanted to learn C++, and this example
        is only one of dozens of things in C++ that THINK doesn't
        do...)

    3)  To learn C++, one must experience C++ and all its small
        tricks, traps and strangeness.  (Design by committee is
        not a very good thing...)


BTW, how many different uses of "const" will C++ accept?  I count 7...
How about "references" ?  THINK has never heard of these things, yet
these are all C++.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
In article <1990Aug15.165548.25740@midway.uchicago.edu> you write:
>
>differences between C++ and C+- are sufficient enough to warrant purchasing
>MPW's C++ if you're really trying to learn C++.

I think you can learn the basics of OOP and C++ by using THINK C.  I even
think you can use the preprocessor to make THINK C more like C++ (e.g.
#define class struct).  

If you are going to use C++ for serious work, then I think you'll eventually
want to take advantage of operator overloading, and you'll definitly want to
define instance variables are private (or protected).  The best part of C++
is theway you can express your problem (using inheritance, const member
functions, public/private, pure virtual functions, etc.) and I don't think
THINK C provides the same level of expressiveness.

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
In article <1990Aug15.165548.25740@midway.uchicago.edu> 
gft_robert@gsbacd.uchicago.edu writes:
> Basically I just wanted to know if someone wanting to learn C++ has any 
reason
> to purchase MPW C++ over THINK C's C+-.

If you really want to learn C++, don't waste your time with the Think 
product. It is a great product viewed on its own merits, but its language 
is a simple OOP extension to C, while C++ is much much more. Think C will 
teach you almost nothing about C++. It has (for example) no multiple 
inheritance, no auto-constructors or auto-destructors, no overloading, no 
user-defined operators, no private or protected fields or methods, no data 
references (a new feature like pointers but different) and so on, and on.

On the other hand, if what you really want to learn is principles and 
techniques of OOP, using C as a basis because you're already familiar with 
it, then I'd recommend Think C 4.0. It'll teach you OOP without the 
dreadful mass of confusing new features, side effects, and syntax that C++ 
introduces. It's also cheaper, faster, and (much!) less of a memory hog 
than MPW C++.

Hope this helps.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Looks like you're going to have to spend some money.  What Think has
is a feature or two of C++, but it bears little resemblance to a full
implementation.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The differences between MPW C++ and THINK C 4.0 are enormous.  If you
would like to hear the nitty gritty, I could give you a rough list of
the features missing from THINK C 4.0.  If you don't know C++, you
may not need such a list, so I haven't included one here.  I myself
own THINK C 4 because I'd bought it when it was still THINK C 3.0.

The main advantages to THINK's product are faster compilation time and
a more intuitive interface.  You don't get the power of a CLI (it's
i]esp. nice to be able to write scripts), but you get to do everything
by point and click, which makes the debugger a lot easier to use.  Oh,
and price.  Can't forget that.

However, THINK's "object C" incorporates maybe 1/4 of the extra
features that make C++ different from ANSI C.  For people who just
want to be able to do some object oriented things, this 1/4 is the
important 1/4.  It gives you inheritance and polymorphism.  However,
it does NOT give you data hiding, multiple inheritance,
operator/function overloading, etc., etc.  You mentioned that someone
wanted to learn C++.  If he just wants to learn an object oriented
language based on C, this may be enough.  However, if he really wants
to learn C++, this is not the way to go.  

I like to program in C++, but I didn't want to pay for it (poor
student) and MPW C++ compiles so slowly that I decided to wait.
Perhaps THINK C will eventually turn into THINK C++ 5.0.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I get the impression (I have THINK C 4.0, but don't use it) that what you
get with T.C. is a proper subset of C++, minus those features specifically
mentioned in the Weston book appendix.  Additionally, with T.C. (C+-) you
get a class library that may/may-not be confusing at some point in the 
future were you to move to a generic C++ environment.  With MPW C++, you
can use any old C++ textbook (suggested is Lippman's); class library-wise,
you get something along the line of MacApp (one way or another -- I don't
have C++ or MacApp) if you want to use it.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Ok.  I don't have the THINK C manuals on me, and I don't have a C++
reference either, so I will probably miss some important things.
However, this should give you the flavor of what is missing.

Constructors/destructors
operator overloading
function overloading
non-virtual member functions (all methods are virtual)
data hiding (no private: or protected: sections in classes)
member function pointers
multiple inheritance
references
new/delete is done differently
can't declare vars except at the beginning of functions
virtual base classes
streams

Well, that's all I can think of.  The important ones are
constructors/destructors, references, overloading, data hiding.  For
example, you want to do the following:

Complex a[30], i(0,1);
a[0] = 5 + 3 * i;

In order to do this, you need constructors, references, and
overloading.  You don't ever NEED data hiding, but it's nice to have.
If one were to design a complex number class, one would definitely use
data hiding.  

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::




 
============================================================================
= gft_robert@gsbacd.uchicago.edu * generic disclaimer: * "It's more fun to =
=            		         * all my opinions are *  compute"         =
=                                * mine                *  -Kraftwerk       =
============================================================================

gft_robert@gsbacd.uchicago.edu (08/17/90)

------- 
In article <1990Aug16.193325.23172@midway.uchicago.edu>, I summarized a lot of
opinions about MPW C++ vs. THINK C 4.0

One thing I think I should mention about the opinions in my summary, since I
left off attributions: none of the statements I summarized is an official
statement from Apple or Symantec (although some people from Apple helped me
out), and I have no way of verifying their accuracy.  

Just thought I'd add that (probably pointless) disclaimer, just in case someone
were to read too much into what I posted.  Again, thanks to all who helped.

Robert

============================================================================
= gft_robert@gsbacd.uchicago.edu * generic disclaimer: * "It's more fun to =
=            		         * all my opinions are *  compute"         =
=                                * mine                *  -Kraftwerk       =
============================================================================