[comp.sys.mac.programmer] THINK C 4.0: first impressions

ech@cbnewsk.ATT.COM (ned.horvath) (09/04/89)

I've had my upgrade about a week, but I've been on the road and mostly
have been reading the class library man pages.

The language is strongly reminiscent of Object pascal; just enough features
to let you do some interesting classes.  Both direct (pointer based,
like C++) and indirect (handle based, like MacApp) classes are supported,
but you inherit that attribute from your superclass (single-inheritance
class hierarchy).  A cute feature is that "object->feature" does the right
thing, generating code equivalent to "(*object)->feature" for handle-based
objects.  With reasonable care, it should be possible to write classes
that migrate freely between C++ and ThinkC.

The class library is strongly reminiscent of MacApp.  It looks REAL nice,
but I'll reserve final judgement until I've had more time to work with it.
The multiple interwoven hierarchies (class; control; visual) are a source
of mild confusion for me.  Whether that confusion will fade or translate
into frustration remains to be seen.

The editor is not quite strong enough to serve as a browser; beefing
up the option-double-click (try to find this symbol's definition) would
help considerably. Finding "inherited::method()" is tedious, but algorithmic,
so I hope Kahl&co. will consider adding it.

As usual, there's no free lunch.  What follows are not really criticisms,
just observations.

- The project size, with all the classes, is large: the trivial example
apps smart-link to around 60K, but the project is more like 500K.

- Apps built with the class libraries need lots of RAM: "Pedestal" ran
out of memory in a 160K partition when I tried to pick from the Apple
menu (on a Mac II in 8-bit color mode, 640x480 display).  Presumably the
MenuMgr couldn't find space to cache the bits it was about to cover up).

- An aside: when Pedestal ran out of space, it displayed a nice
little alert, to the effect of "Mac error -108".  The application
methods that caught and saved the app are in the class library.  Now, 
"please increase the RAM assignment" is a bit friendlier, but -108 is
plenty fine for programmer types.

- A two-meg machine is just adequate for development.  The ThinkC app itself
hurts if you try to reduce the RAM below the 700K recommendation.  The
Debugger is anemic at the assigned 200K if you're using the class libraries;
it seems happy at 250K, but so far that's just the trivial apps.  Add
Finder, Multifinder, a reasonably lean system (add about 100K each for
Suitcase and TMON) and you've only got 200K or so left for an app.
I suppose I COULD turn off one of those last two, but I'd probably start
biting my nails again without TMON in the machine.  I don't know how well
the Think/Debug/App arrangement works with Virtual or the new Apple VM --
Rich, can you comment?

At the moment, the only competition for this package is MacApp, if you are
a pascal type.  The latest APDALog includes a note from Jordan Mattson to
the effect that C++ won't be in beta 'til 4Q89, and released 2Q90.  MacApp
for C++ isn't even scheduled that definitely, an optimist would hope for
2Q90.  ParcPlace has announced ObjectWorks for the Mac, but I don't know if
it's shipping yet; price figures to be in the $500-$600 range.

Oh, yeah:  I haven't actually TRIED this yet, but the multi-segment,
A4-based code resource stuff supports classes.  To the best of my
knowledge, this is the only (shipping) development system for the Mac
that can make that claim.  I've been critical of Apple's studied silence
on this issue for MPW-based tools, so kudos to the Think team for doing
the right thing.  My concern is not that I want to write 200K XCMDs, but
that once I get used to using things like container types and nested
grafPorts, I don't want to have to go back to the bad old ways
just because I'm doing a DA or XCMD.

All in all, looks REAL GOOD.  Nice work, guys and gals!

=Ned Horvath=
Disclaimer: I've used 5 different C development systems for the Mac, and
helped to write two of those.  ThinkC wasn't either of them, unfortunately.

siegel@endor.harvard.edu (Rich Siegel) (09/05/89)

In article <949@cbnewsk.ATT.COM> ech@cbnewsk.ATT.COM (ned.horvath) writes:
>- The project size, with all the classes, is large: the trivial example
>apps smart-link to around 60K, but the project is more like 500K.

	Once you get comfortable with the TCL, you can turn off debug
table generation for the TCL class files, and save a fair amount of
space in the project.

>I don't know how well
>the Think/Debug/App arrangement works with Virtual or the new Apple VM --

	I don't know about Apple's virtual memory, but I'm using Virtual
on my Mac II, and don't have any troubles.

		-Rich



~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

"There is no personal problem which cannot be solved by sufficient
application of high explosives."

~~~~~~~~~~~~~~~

dgold@apple.com (David Goldsmith) (09/06/89)

In article <949@cbnewsk.ATT.COM> ech@cbnewsk.ATT.COM (ned.horvath) writes:
> The latest APDALog includes a note from Jordan Mattson to
> the effect that C++ won't be in beta 'til 4Q89, and released 2Q90.  
MacApp
> for C++ isn't even scheduled that definitely, an optimist would hope for
> 2Q90.

As I've mentioned before, people are writing MacApp programs in C++ inside 
Apple right now (ViewEdit has even been converted to C++).  Because of the 
interoperability between MPW C++ and Object Pascal, it isn't necessary to 
have a special version of MacApp for C++, just a set of .h files.  Those 
exist right now, but I don't know when they will be released through APDA.

David Goldsmith                                         Apple Computer, Inc.
AppleLink: GOLDSMITH1    BIX: dgoldsmith       20525 Mariani Avenue, MS: 77A
UUCP: {nsc,dual,sun,voder,ucbvax!mtxinu}!apple!dgold     Cupertino, CA 95014
CSNET: dgold@apple.com

sho@pur-phy (Sho Kuwamoto) (09/06/89)

In article <4031@internal.Apple.COM> dgold@apple.com (David Goldsmith) writes:
>As I've mentioned before, people are writing MacApp programs in C++ inside 
>Apple right now....

Personally, I think it's high time that MPW went through a price cut.
You can pick up THINK C for <$100.  The MPW C bundle costs $400,
MacApp costs $100, plus any additional costs for C++.  I understand
that Apple has to be careful not to step on developer's toes, but it
is my belief that THINK C would still have a large market share even
if MPW cost the *same*.  Because of this belief, I don't think it
would be unreasonalbe to price a C package at around $250 including
MacApp.  I would like to have *both* devlopment environments around...
Maybe have APDA products available through the Apple University
Consortium deal, for about 50% off.  That would do the trick for me.

-Sho
--
sho@physics.purdue.edu  <<-- poor starving grad student.

jnh@ecemwl.ncsu.edu (Joseph N. Hall) (09/06/89)

> ParcPlace has announced ObjectWorks for the Mac, but I don't know if
>it's shipping yet; price figures to be in the $500-$600 range.

To the best of my knowledge, Objectworks for Smalltalk-80, on the Mac, 
has been shipping for a while.  The price was dropped from $1000 to $600
a while ago.  Also, educational users (students, faculty and staff) qualify
for a $150 price ... this applies to ALL educational institutions.
Not an "academic edition" either; you get all 1500-odd pages of documentation,
etc. just like the people who pay 4x as much.

v   v sssss|| joseph hall                      || 4116 Brewster Drive
 v v s   s || jnh@ecemwl.ncsu.edu (Internet)   || Raleigh, NC  27606
  v   sss  || SP Software/CAD Tool Developer, Mac Hacker and Keyboardist
-----------|| Disclaimer: NCSU may not share my views, but is welcome to.

ra_robert@gsbacd.uchicago.edu (09/06/89)

In article <2509@pur-phy>, sho@pur-phy (Sho Kuwamoto) writes...
> 
>Personally, I think it's high time that MPW went through a price cut.
>You can pick up THINK C for <$100.  The MPW C bundle costs $400,
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I agree with your main point: that MPW products should cost less than they do. 
But just to be accurate: where can you pick up THINK C 4.0 for less than $100? 
The upgrade alone cost $74.  Isn't it about $150 on the streets?

It's a great bargain for the price in any case, but it's not less than $100.

Robert
======
ra_robert@gsbacd.uchicago.edu
=============================
generic disclaimer: all my opinions are mine

sho@maxwell.physics.purdue.edu (Sho Kuwamoto) (09/07/89)

In article <5295@tank.uchicago.edu> ra_robert@gsbacd.uchicago.edu writes:
>In article <2509@pur-phy>, sho@pur-phy (Sho Kuwamoto) writes...
>>Personally, I think it's high time that MPW went through a price cut.
>>You can pick up THINK C for <$100.  The MPW C bundle costs $400,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>I agree with your main point: that MPW products should cost less than they 
>do.  But just to be accurate: where can you pick up THINK C 4.0 for less 
>than $100?  The upgrade alone cost $74.  Isn't it about $150 on the streets?
>
>It's a great bargain for the price in any case, but it's not less than $100.

Quite.  Oops.  I was thinking of THINK pascal.....

I called in for my upgrade (C, not pascal) about two weeks ago, I
think.  Hope it gets here soon.  Can't wait to rewrite my >250 page
data analysis program with objects!  Shows you how much of a geek I
really am.

Personal to Robert:

say, do you know anyone by the name of Ed Yao there?  I knew him from
highschool and worked with him this summer.  He seems to have an
account on the same machine as you, that's all.

-Sho
--
sho@physics.purdue.edu  <<-- fester.

wrp@biochsn.acc.Virginia.EDU (William R. Pearson) (09/10/89)

	I have having a lot of problems with THINK C v4.0, it seems to
be full of bugs, and somewhat less Unix friendly than v3.0 or 2.0.  For
example, strncmp() does not work correctly.  Try the following program:

#include <stdio.h>

main()
{
	char *str1, *str2;

	str1 = "This is a string";
	str2 = "This";

	printf(" %s : %s - %d\n",str1,str2,strncmp(str1,str2,4));
	}

Since I do not speak 68000 asm, it is not clear to me where the bug is.
Since many other things have stopped working, I am not certain how many
there are.

Bill Pearson