Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!gatech!ncsuvx!ecemwl!jnh From: jnh@ecemwl.ncsu.edu (Joseph N. Hall) Newsgroups: comp.sys.mac.programmer Subject: C++ ... setting new standards for patience Message-ID: <4208@ncsuvx.ncsu.edu> Date: 17 Oct 89 12:39:07 GMT Sender: news@ncsuvx.ncsu.edu Reply-To: jnh@ecemwl.UUCP (Joseph N. Hall) Organization: North Carolina State University Lines: 53 Well, I got my copy of C++ 3.1B1 yesterday, and my first impression was that it is _impressively_ slow. I compiled the TESample program, broken into four files, on a Mac Plus and it took, oh, 10 or 15 minutes. There are only about 2000 lines of .cp code there, mind you! However, a little inspection revealed that the example includes just about every .h file it can get its hands on. The TESample program was broken up into 4 parts to illustrate a kind of one-class-one-file approach to OOP. This means, of course, that all of these header files are processed 4 times by cfront ... Cfront isn't too sluggish when compiling "normal" C++ code, except that including produces another pretty good endurance test. Naturally, there is no #pragma load for cfront. Not only do you have to include _more_ headers with cfront, you can't pre-compile them, and they are processed more slowly by cfront than by c, THEN they have to be processed by C, and they STILL can't be pre-compiled. The result, if you're used to working with a lot of little files (I prefer 500-1000 lines max), is a "sloth" demon. I plan to get over my squeamishness toward longer source files very quickly. Cfront and C include special "gibberish" switches (-z3) that produce and read (respectively) special non-TEXT output; these aren't documented but are used in the CPlus script. The result, when there's an error that isn't caught by cfront but which is caught by C, is something like: # # # ? ### Error 123 xxxxxxxxx #------------------------------------------------------------- File "test.cp"; Find *!49:$!1; Open "{Target}" #------------------------------------------------------------- ... which isn't the most intuitive error message possible. If you select the error message and hit ENTER, as usual, though, you are magically transported to the approximate location of the source of the error in the original source file. Weird, but you get used to it. In any event, the biggest "con" of MPW C++ is that it is slo-o-ow and that the slo-o-ow-ness is difficult to work around. The "pro," of course, is that it IS C++, and is an up-to-date AT&T C++ v.2.0 which will probably be well supported in the future. I wish I could see the amount of candy bars and coffee consumed by the System 7.0 writers while they waited on CFront ... 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.