TweetFollow Us on Twitter

MacApp and Prograph
Volume Number:11
Issue Number:5
Column Tag:Visual Programming

MacApp and Prograph CPX - A Comparison

By Kurt Schmucker, Advanced Technology Group, Apple Computer, Inc.

Note: Source code files accompanying article are located on MacTech CD-ROM or source code disks.

Designing and implementing an event-driven application with a sophisticated graphical user interface is a difficult task. Fortunately, a number of years ago Larry Tesler and other researchers at Apple came up with a way of making both the design and the implementation of a Macintosh application considerably easier. What they did was to design a working skeleton application that you could easily customize. Unlike earlier skeleton apps, this new one did much more, was more easily extended, and yet required you to learn much less about its inner workings. The main reason they were able to do this was that they used an object oriented language and designed their skeleton as an interlocking set of classes in that language. The resulting skeleton became known generically as an application framework and resulted in an Apple product called “MacApp - The Expandable Macintosh Application”. [1] Other application frameworks from other companies followed: some were Macintosh application frameworks and others were for other platforms. However, MacApp, as the first and the generally most full featured, remains the standard against which all new application frameworks are measured.

When CPX first came out, I embarked on a project to compare it to MacApp by reimplementing some of the MacApp sample programs in CPX, seeing what could and couldn’t be done, measuring RAM and disk footprints, measuring the performance of the resulting apps, etc. I have gotten far enough on this project to do a fair comparison, and this article will document what I have been able to do, and the conclusions I have reached.

However, not everything in this article will be objective numerical data like RAM footprint measurements. Developers are emotional about their tools, and why shouldn’t they be? You spend a great deal of time and effort learning to use a tool, and once mastered, you rely heavily on that tool for your livelihood. I am no exception to this. While I will present the factual data that I was able to generate in doing this comparison, I will also add my own personal opinions and impressions about MacApp and CPX. In addition, since it is difficult to isolate a tool from the environment it’s used in, I will also compare the total development experience of MacApp and CPX, including programming languages, build times, auxiliary development tools like direct manipulation window layout editors, etc.

Characteristics of an Application Framework

A Macintosh application framework is a set of classes in some object-oriented language designed in such a way that:

• it is a stand-alone, double-clickable, ‘vanilla’ Macintosh application. (Because it is an app, it has a working menu bar, can open multiple windows each of which are movable, resizable, etc., works with the clipboard, prints, and exhibits all the other standard behavior that a Macintosh user expects. It is a vanilla app since all the windows are empty, the menus are blank, and it prints out blank paper.)

• it can easily be extended by subclassing and overriding. (For example, to get a new type of window that draws three-d renderings of a molecule, you subclass the Window class, and override its Draw method (or the Draw method of an auxiliary object) and include the molecule drawing code in that new method.)

• it provides a set of special null methods that enable the framework to access your code. You override these methods to do routine customization like enabling menu items, processing mouse clicks, etc. (These special methods are called ‘hook methods’. [2])

• it provides an architecture that makes adding standard Macintosh UI features like undo, cut & paste, publish & subscribe, standard file dialogs, context-sensitive cursors, etc., very easy to do.

• it provides a widget set of standard Macintosh controls (for example, radio buttons, click boxes, and scroll bars).

With this definition of an application framework, both MacApp and the CPX ABCs are application frameworks, and so are THINK’s TCL [3], Microsoft’s MFC, and MetroWerks’ PowerPlant. A more comprehensive overview of frameworks can be found in [4].

Since the whole point of an application framework is to make the task of building applications easier, the typical measure of a framework’s success is the number of ‘shipping’ applications that have been built with it. (While this seems like such a common sense approach to measuring the success of a tool that it should almost go without saying, I have not always found this to be the case. At an academic conference on User Interface Management Systems - a research approach to generating GUIs automatically that has not yet seen commercial use - one smart aleck remarked that the differences between frameworks and UIMSs is that frameworks measure their success in apps/year whereas UIMSs measure their success in dissertations/decade. The really surprising part is that this remark was intended to poke fun at the lack of real-world UIMS success after many years of research, but the UIMS researchers thought that this measure was an excellent one, and accurately gauged their contributions. There is just no insulting some people.) {OK, OK, I’ll confess. The above-mentioned smart aleck was me.}

Table 1. A quick comparison of the gross characteristics of MacApp and Prograph CPX.

Are MacApp and CPX Comparable?

Table 1 shows the results of a comparison of the gross characteristics of MacApp and CPX. This quick comparison shows that these two frameworks are roughly comparable in size and targets, although MacApp, being more mature, has a considerably larger set of shipping apps.

Detailed Comparisons

Intro to MacApp

I assume that all the readers of MacTech have some knowledge of Prograph (the language, the development environment, and the ABCs) from earlier articles (for example, [5]). However, I don’t assume any previous experience with MacApp, so let me give a short intro to MacApp, from the perspective of a Prograph CPX user. (If you want a more detailed intro to MacApp, see [2] or [6].)

MacApp is a C++ Macintosh application framework consisting of over 200 classes and 2100 methods. Since it is a framework supporting the generation of Macintosh applications, many of the classes in the framework reflect the basic Macintosh UI concepts: TApplication, TDocument, TWindow, TButton, TClipboardView, and so on, and the run-time interconnections between these objects reflect the structure of most Macintosh-style apps: the single TApplication object maintains a list of all the TDocument objects which in turn maintain lists of their TWindow objects which also maintain lists of their window widgets. In addition, there are classes that represent common abstractions like views (TView), user requests for action (TCommand), and frequently used building blocks (TList).

Any typical MacApp application will have a single subclass of TApplication, one or more subclasses of TDocument, zero or more subclasses of TWindow, and one or more subclasses of TView and TCommand respectively. These subclasses will override the hook methods - all of which have the common naming convention of starting with “Do”, as in “TDocument.DoMakeWindow” and “TView.DoMouseCommand”. In these regards, MacApp and the CPX ABCs are very similar.

MacApp has always been a Macintosh-only framework: compile on the Macintosh for the Macintosh. Last May (May 94), MacApp 3.1 shipped with support for the generation of PowerPC native applications. And MacApp 3.5, with support for OpenDoc™ container apps, is now in alpha release.

There are about 200 or so shrink-wrapped apps implemented with MacApp. Of these, Adobe PhotoShop is the best known, but others include Ray Dream’s suite of high-end rendering applications, Intelligenetics GeneWorks, Spyglass Dicer, Apps MicroTV, Exis MacDSS, Odesta GeoQuery, MacTerminal, and the Apple developer tools ViewEdit and BalloonWriter. Like other frameworks, MacApp is often used for in-house applications, so its true success is often underrated.

MacApp ships with about ten example applications, all provided in source code. These range in complexity from the smallest possible MacApp application, Nothing, to a full spreadsheet application, and a small structured graphics editor. All MacApp users read, copy, and are influenced by the source code of these samples.

There are a variety of separate development tools associated with MacApp - browsers, window layout tools, source-level debuggers, run-time inspectors, etc. Some of these are provided by Apple (MPW, ViewEdit, SourceBug, and MacBrowse, to name a few) and others, often competing tools, are offered by third parties (e.g., IcePick, Object Master, The Debugger, and CodeWarrior.) Most MacApp developers feel compelled to become proficient in many of these tools. Unfortunately, the languages and user interface conventions of the tools are not uniform.

Re-implementing the MacApp Samples

The project I decided to use to do a detailed comparison between MacApp and CPX was to re-implement some of the MacApp samples. This enabled me to test a wide variety of CPX features in a number of different contexts, yet was a project of reasonable size (especially important in an ‘on-your-own-time’ coding effort). While this project has proven to be very illuminating - both about MacApp and about CPX - it is not a flawless approach for an in-depth comparison. Flaws include:

• Size. The MacApp samples range in size from tiny toy apps to small apps. Even the largest (Calc) is only about 12,000 lines of C++. Thus, this re-implementation project really doesn’t test the ability of CPX to build full size commercial products. (Of course, re-implementing PhotoShop in Prograph just to see if it can be done is a little more than I am willing to do just for fun.)

• Feature coverage. The MacApp samples were designed to demonstrate and test the features of MacApp, and thus they may not necessarily be representative of the types of apps that CPX is designed for. (At the very least, I should attempt the reverse test: re-implementing the CPX samples in MacApp. I have not done this since once I had done a significant amount of Prograph programming, it is very difficult to work up the motivation to return to the murky depths of C++, MPW, or even text-based programming at all. So, my work may be slightly one sided, but it is better than having no data at all.)

I have re-implemented four of the MacApp samples in CPX: Nothing, DemoText, IconEdit, and DemoDialogs. I used the built MacApp samples as runnable specifications for what I would implement in Prograph, and I purposely did not look at the MacApp code to see how some feature was implemented. (I have been a MacApp programmer for years and have studied the implementations of all the MacApp samples to some degree at some time or another. However, I didn’t specifically re-examine the code while I was doing my Prograph re-implementation.)

The first two of these samples, Nothing and DemoText, were extremely easy and the re-implementation effort mainly amounted to re-arranging menu items on the standard Prograph menus to match those of the MacApp samples. Primarily, the re-implementation task for these two samples was easy because the functionality of these apps is so small, and they are direct uses of classes like TTEView (in MacApp) or EditText (in Prograph) so there is very little to do but ‘wrap’ these classes in an application. Secondarily, the re-implementation was easy since there were Prograph samples that were quite similar in functionality, and all I had to do was modify and extend them slightly to match the functionality of their MacApp counterparts.

Re-implementing IconEdit was more code, but once I had fixed a small bug in Prograph’s undo handling [7][8], it was not too difficult to get all the IconEdit functionality. One portion of the app that is tricky to implement in both versions is the handling of the editing of the icon, in particular, making sure that the user can mouse down in the fatbits view, move the cursor around while drawing, and then mouse up. Of course, choosing undo should then remove all the drawing added between the mouse down and the mouse up, not just undo the setting of the last drawn bit. Here is the C++ code from the MacApp version:

TIconDrawCommand::TrackMouse: 
#pragma segment ADoCommand

pascal TTracker* TIconDrawCommand::TrackMouse(
 TrackPhase aTrackPhase, VPoint&   /*anchorPoint*/,
 VPoint& previousPoint,
 VPoint& nextPoint, Boolean mouseDidMove)
{
 VPoint fromBit, toBit, iconBit;
 short  lineLength;
 float  deltaH, deltaV;
 float  h, v;

 if (mouseDidMove) // If mouse moved since last time 
 {
    // Convert nextPoint and previousPoint to bit locations in the icon 
 fIconEditView->PointToBit(
 fIconEditView->ViewToQDPt(nextPoint), toBit);
 fIconEditView->PointToBit(
 fIconEditView->ViewToQDPt(previousPoint), fromBit);

 if (aTrackPhase == trackPress)
 {
 fOriginalIcon = fIconBitMap->Copy();
    // Make a copy of the original.
 fTurnBitsOn =!fIconBitMap->GetBit(toBit);   
    // Turn bits on or off?
 }

// The following sets bits in the icon from the bit at previousPoint 
// to the bit at nextPoint.  It is based on a simple line-drawing algorithm.
 lineLength = (short) Max(labs(toBit.h - fromBit.h), 
 labs(toBit.v - fromBit.v));
 lineLength = (short) Max(1,lineLength);     
    // This is on two lines so that Max can be "inlined"
 
 deltaH = (toBit.h - fromBit.h) / lineLength;
 deltaV = (toBit.v - fromBit.v) / lineLength;
 h = fromBit.h + 0.5;
 v = fromBit.v + 0.5;

 for (short i = 0; i < lineLength; i++)
 {
 iconBit.h = h;
 iconBit.v = v;
 fIconBitMap->SetBit(iconBit, fTurnBitsOn);
    // Set the bit in the icon
 fIconEditView->DrawBit(iconBit, fTurnBitsOn);
    //  and draw it in the edit view.
 h = h + deltaH;
 v = v + deltaV;
 }
 }
 return this;  // Return same command object.
} // TIconDrawCommand::TrackMouse 

TIconDrawCommand::TrackConstrain: 
#pragma segment ADoCommand

pascal void TIconDrawCommand::TrackConstrain(
 TrackPhase /*aTrackPhase*/,
 const VPoint&   /*anchorPoint*/ ,
 const VPoint&   /*previousPoint*/ ,
 VPoint&nextPoint,
 Boolean/*mouseDidMove*/)
{
    // This is on several lines so that Max can be "inlined"
 VCoordinate h = Min(nextPoint.h, 
 fIconEditView->fSize.h - kBorder - 1);
 VCoordinate v = Min(nextPoint.v, 
 fIconEditView->fSize.v - kBorder - 1);
 h = Max(h, (long) kBorder);
 v = Max(v, (long) kBorder);
 nextPoint = VPoint(h, v);
} // TIconDrawCommand::TrackConstrain 

TIconDrawCommand::DoIt: 
#pragma segment ADoCommand

pascal void TIconDrawCommand::DoIt()
{
 VRect editViewExtent;

 fIconDocument->SetIcon(fIconBitMap); // Set the document’s bit map.

    // SetIcon invalidates all views of the document, including the one we just drew in. 
    // To avoid flashing, validate the edit view here so it doesn’t get redrawn.

 fIconEditView->GetExtent(editViewExtent);   
 fIconEditView->ValidateVRect(editViewExtent);
} // TIconDrawCommand::DoIt 

and Figure 1 shows the approximately equivalent Prograph code (together with some of its scaffolding, so that you can more easily see what is going on.) Perhaps it is my visual coding bias, but I find the Prograph code much easier to read and quicker to understand.

Figure 1. The implementation of fatbits drawing for the
IconEdit sample program re-implementation in Prograph.

I also took the opportunity while doing the IconEdit re-implementation to add Filters & Sieves to the Prograph application framework - something I had always wanted to do with MacApp, but was never able to work up the courage to delve that deeply into the inner working of MacApp. [9] With Prograph, and especially because of its excellent editor/interpreter/debugger environment, I was able to accomplish this, and enjoyed doing it.

DemoDialogs was a much bigger effort. The MacApp version is about 3500 lines of C++ and is basically a collection of all the window types and widgets that MacApp supports, and demonstrations of how to build your own if MacApp doesn’t provide them directly. DemoDialogs is the kind of sample program that is actually a collection of small samples: you look up a portion of the source code to see how that single feature was implemented. (Other types of sample programs include those that are good starting points for certain types of applications (e.g., DrawShapes or Skeleton), those that are just tours de force of the power of the framework (Nothing), or those that are tutorial in nature (IconEdit)). The MacApp DemoDialogs has example windows of the type that are seen in every Macintosh application (save dialog, print dialog, etc.), commonly used windows (e.g., a font picker like you would see in any word processing application), some windows that you see occasionally (windows with custom controls, windows with arrays of buttons and other widgets), and then some windows that you never see, but show off some feature of MacApp (a View inspector that shows you the internal structure of any other window in DemoDialogs). The feeling that you get after using DemoDialogs for a little while is that MacApp will probably be able to build any type of window that you want, and it may even provide direct support for that kind of window.

The final result of my DemoDialogs re-implementation effort is that I was able to implement all the functionality of DemoDialogs except for only one small, but possibly significant feature: large views. (Discussed in detail below.) Figure 2 shows all the windows of the CPX DemoDialogs. (A similar figure for the MacApp implementation would be exactly the same, so I have not included it here.) The Prograph implementation of DemoDialogs, like the MacApp original, gives you the feeling that you can create any type of window with CPX. The CPX re-implementation of DemoDialogs is perhaps a little bit slower, but comparable in perceived responsiveness to the MacApp version. The Prograph version does have a somewhat little larger RAM footprint. (See the detailed measurements on RAM and disk footprints later in this article.)

Figure 2. The windows of the CPX implementation of DemoDialogs. Note that a similar figure of the windows of the MacApp implementation would be virtually identical.

The single feature of DemoDialogs that is not easily implementable in Prograph is a 10,000 element scrolling list. Like MacApp 1.0, Prograph uses standard 16-bit QuickDraw coordinates for its views. This limits the size of views. MacApp 2.0 (and later) went to 32-bit coordinate representations for all view objects, including scrolling lists. The result was that the biggest scrolling list that I could build in Prograph was about 1,000 elements in length. Whether this is significant to you or not, depends in the types of applications you want to do. Details of the DemoDialogs re-implementation are discussed in [10].

Which is Better, MacApp or CPX?

There is no quick easy answer to the question of which of these two frameworks is better since both products are significant, feature-rich frameworks that provide great utility to their users. In addition, there are many of aspects of both MacApp and CPX that this sample re-implementation test doesn’t stress. For example, both MacApp and CPX support far code and far data - features that will only really be used in larger applications (greater than 4000 methods or more than 32K of global data). However, it is possible to list some of the aspects of each that are better than those of the other framework.

What’s Better in MacApp?

Sample Programs. The MacApp sample programs are significantly broader and deeper than those in Prograph, and there are more of them.

Clipboard View. While both MacApp and CPX support the Macintosh clipboard for copying and pasting of text and pictures, MacApp also implements a clipboard view so that you can trivially add a “Show Clipboard” menu item to your application. I also found the MacApp approach to providing clipboard support for your application’s data types (TApplication.MakeAlienViewforClipboard) to be much easier to understand and to use. (I do wish, however, that MacApp’s clipboard supported more than just text and pictures, but also included QuickTime movies, sound, etc.)

Low memory handling. MacApp’s mechanism for dealing with low memory situations is more robust and more useful than Prograph’s Rainy Day Fund.

Publish and Subscribe. MacApp provides a framework for supporting the Macintosh publish and subscribe mechanism (actually, it is a unified framework for the clipboard as well as P&S). MacApp handles a lot of the details of the P&S user interface (borders, standard dialog boxes, etc.) for you.

Adorners. MacApp’s mechanism for adding some drawing adornments to views is better at this task than the borders mechanism is in CPX. For one thing, the adorners mechanism enables you to add multiple adorners to a single view.

What’s Better in CPX?

Language. Prograph is a more readable, simpler language than C++, yet it is just as powerful. In fact, it isn’t possible to write syntactically incorrect Prograph code, and semantic errors often jump out at you in even the most casual examination. The clarity of code expressed in Prograph is due, in part, to the fact that algorithms, by their very nature, have an inherent internal structure. Often, implementing an algorithm in a textual, and thus necessarily linear fashion, hides this structure. In contrast, the Prograph language brings this structure to the surface and enables the Prograph-literate programmer to grasp this structure in a single gestalt. Prograph programmers also don’t need to spend time thinking up descriptive names for temporary variables in their code, they just draw a data flow line between the point where the data is generated and where it is used. Data is typed dynamically and this makes both prototyping and significant architectural changes easier.

Environment. Prograph has a fast garbage collector, an integrated source-level debugger - which lets you change code or data while your application is running - and an extensible window and view editor.

Behaviors. Behaviors provide a much easier to use, and much more flexible way for your code to be accessed by the framework than MacApp’s hook methods. With a behavior, you are no longer constrained to the parameter list of the hook method. In addition, CPX will retrieve some data for you (like getting values out of text items in dialog boxes.) Consider, for example, the task of responding to a click on a button in a dialog box. Here is what you have to write in MacApp:

TModelessBeepDialog::DoEvent: 
#pragma segment ARes

pascal void TModelessBeepDialog::DoEvent(
 EventNumbereventNumber,
 TEventHandler*  source,
 TEvent*event)// override 
{
 long i;
 long maxi;

 switch (eventNumber)
 {
 case mButtonHit:  // Default button and Enter or Return key
 {
 maxi = ((TNumberText *)
 (FindSubView('numb')))->GetValue();
 if (this->IsHierarchyValid())
 for (i = 1; i <= maxi; i++)
 gApplication->Beep(2);
 break;
 }
 default:
 inherited::DoEvent(eventNumber, source, event);
 }
} // TModelessBeepDialog::DoEvent 


Figure 3 shows the simple dialog you have to fill out, and the small amount of code that you have to write to achieve the same result in CPX.

Figure 3. Handling a mouse down in a button is easy because of Prograph Behaviors.

Menus. For the MacApp programmer, menus exist at the boundary between the object world of MacApp and the lower-level world of the Toolbox. Some of the programming tasks are in one world and language (DoSetupMenus) and some in another (“Arrow”, noIcon, noKey, noMark, plain, cArrow). Having taught many MacApp classes, I can testify that this can be a considerable stumbling block to the new MacApp user. Thus, in the total task of adding a new menu or menu item to a MacApp application, you have to constantly flit back and forth between a number of different programming tools each with its associated language(s) and style of usage. You code in an object language to implement the main functionality of your app, in a strange C-like language (Rez) to describe your menus, and in even stranger language (MPW Shell) to build your application. Along the way you have to use separate applications (e.g., ViewEdit and ResEdit) to build in a direct manipulation style some of the objects that your menus will operate with or on.

CPX changes this dramatically by making menus and the menubar into objects that you deal with in exactly the same way that you deal with other objects like windows and views. The Menus section in the CPX ABCs provides you with eight classes associated with menus, with the classes Menu, Menubar, and Menu Behavior among them. These classes provide you with methods that add or remove menus from the menubar, add or remove items from an individual menu, enable a menu item, test to see if a menu item is checked or enabled, and find an individual menu or menu item, among other things. You invoke direct manipulation object editors for the menubar and menu objects in exactly the same way that as for windows or views or any other object. There isn’t any need to use another separate tool to accomplish a critical portion of the basic task of implementing the menu functionality of your app. Internally, CPX still deals with the Toolbox Menu Manager and uses the Macintosh ROM to implement menus. However, all the Toolbox details are abstracted for you by CPX and you deal with menus as objects.

This small change of moving menus from the Toolbox to the framework dramatically simplifies both the programmer’s model and the task of getting that first application up and running. Just as important, abstracting away the Toolbox details simplifies porting your CPX source code to other platforms.

Offscreens. Getting smooth screen refreshes in MacApp is tricky and involves buying a third party product (OSImage) or rolling your own code in support of GWorld and offscreens. In CPX, all you have to do is allocate an Offscreen object (part of the CPX class library) and attach it to a window. Nothing could be simpler.

Simple tasks are simpler. I have found on many occasions that a number of conceptually easy tasks (opening a window, responding to a menu item choice, etc.) are just much easier in CPX than in MacApp. Here is a case in point that brings together many of these: posing a dialog. First the MacApp way:

TTestApplication::MakeModalBeepDialog: 

pascal void TTestApplication::MakeModalBeepDialog(
 CommandNumber aCommandNumber)
{
 TWindow *aWindow;
 IDType dismisser;
 long   n;

 FailNIL(aWindow = gViewServer->NewTemplateWindow(
 (short)aCommandNumber, NULL));
 dismisser = aWindow->PoseModally();
 if (dismisser == 'ok  ')
 n = ((TNumberText *)
 (aWindow->FindSubView('numb')))->GetValue();
 else
 n = 0;
 aWindow->Close();
 for (long i = 1; i <= n; i++)
 gApplication->Beep(2);
} // TTestApplication::MakeModalBeepDialog 

Notice how many concepts are buried in the main line:

FailNIL(aWindow = gViewServer->NewTemplateWindow(
 (short)aCommandNumber, NULL));

The view server, window templates, the MacApp failure handling mechanism must be understood, and you have to tell the C++ compiler again that the first parameter to a standard MacApp utility routine is an integer. Contrast this with the CPX way shown in figure 4. Much simpler. However, even this code is not the simplest possible. Dan Shafer suggested to me an even simpler way shown in Figure 5 in which you write no code at all. What could be easier?

Figure 4. Displaying a modal dialog in the Prograph CPX framework.
The equivalent code in MacApp is:

FailNIL(aWindow = gViewServer->NewTemplateWindow(
 (short)aCommandNumber, NULL));
dismisser = aWindow->PoseModally();

Figure 5. While the Prograph code in figure 4 looks simple,
here’s an even simpler way.

Measurements

I have been able to gather some objective data about RAM and disk footprints, and performance of one easily timed interaction.

RAM and Disk Footprints

Figures 6 and 7 show the RAM and disk footprint comparisons of four of the MacApp samples and my re-implementations of them. Note that there is a constant increment for the Prograph versions of about 200-300K in the case of disk footprints and 300-400K in the case of RAM footprints. A little more than half of this increase can be accounted for by the additional symbol tables that Prograph must maintain so that it can do by name dispatching at run-time (‘inject’ in Prograph terminology).

Figure 6. A comparison of the RAM footprints for four of the MacApp samples,
and their re-implementations in Prograph.

Figure 7. A comparison of the disk footprints for four of the MacApp samples,
and their re-implementations in Prograph.

What can’t be determined from this data is whether these increments will be remain constant as the size of the application grows, or whether they too will grow. If they are constant, then an additional 400K memory hit is not too significant when the app is expected to require a 6MB RAM partition. An examination of the RAM footprint of shipping Prograph applications shows that they do not have exorbitant RAM requirements, which suggests that the Prograph RAM increase is a constant, or a very slowly growing function.

Performance

Measuring interaction performance objectively can be difficult. Subjectively, as I already noted above, MacApp apps seem slightly snappier but approximately comparable with their Prograph counterparts.

I was able to find one interaction where objective timing data could be gathered. In the DemoDialogs application, there is a Celsius-Fahrenheit control in which the user can dial in a temperature on one scale and see the value in the other scale displayed. (See figure 8.) The dialing controls respond to mouse clicks with single increments or decrements, or if the mouse button is held down, the numbers increment as quickly as possible with all intermediate numbers displayed. This suggested to me the following test: Hold the mouse button down for five seconds in the increment Celsius control and see how large the Celsius edit text value gets in that fixed amount of time. This test measures ToolBox access (StillDown), conditional evaluation, integer arithmetic, integer to string conversion, and view refreshing. Table 2 shows the surprising results of this test. Does this mean that Prograph is ten times the speed of C++? No, it doesn’t. What this means is that language speed differences are dominated by better algorithmic choices, especially for time-consuming operations like screen refreshing, and in this particular case Prograph has the better algorithm.

Figure 8. The custom temperature conversion control, from the DemoDialogs sample, that was used for a speed test between MacApp and Prograph.

Table 2. Timing test results between MacApp and Prograph.

In this test, the mouse button is pressed for 5 seconds over the Celsius increment control, and the Celsius edit text field increase as quickly as it can, displaying all intermediate values. The table record how many degrees were incremented in the 5 seconds. The surprising result is that interpreted Prograph is about four times as fast as compiled MacApp, and compiled Prograph is about nine times as fast as compiled MacApp. Note that this does not mean that overall a Prograph app will be nine times as fast as a MacApp one, but that some computations can be.

Overall

What more can I say than that Prograph CPX is has been my development environment of choice for producing applications for the past two years or so, and will probably remain so for the foreseeable future.

References

[1] Ken Doyle, Barry Haines, Mark Lentczner, and Larry Rosenstein, “An Object Oriented Approach to Macintosh Application Development”, Journées Langages Orientés Objet, BIGRE + GLOBULE, Nov. 1984, pp. 46-54.

[2] Schmucker, Kurt. Object Oriented Programming for the Macintosh, Hayden Book Company, 1986.

[3] Parker, Richard O. Easy Object Programming for the Macintosh using AppMaker and THINK Pascal, Prentice-Hall, 1993

[4] Lewis, Ted (ed.). Application Frameworks, Prentice-Hall, 1995.

[5] Schmucker, Kurt. “Prograph CPX”, in Application Frameworks, Ted Lewis (ed.), Prentice-Hall, 1995; reprinted in MacTech Magazine, November, 1994, pp.69-80.

[6] Wilson, David A., Rosenstein, Larry S., and Shafer, Dan, Programming with MacApp, Addison-Wesley, 1990.

[7] Schmucker, Kurt. “A Tutorial on ‘Undo’ in CPX”, Visual News, July 1994, pp. 7-12.

[8] Schmucker, Kurt. “Commands and Undo in Prograph CPX”, MacTech Magazine, January 1995, pp. 18-31.

[9] Schmucker, Kurt. “Filters and Sieves in Prograph CPX”, MacTech Magazine, March 1995.

[10] Schmucker, Kurt. “DemoDialogs in Prograph CPX”, FrameWorks, Volume 8, Number 2, (March/April 1994), pp. 8-13.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Adobe Illustrator 24.1.3 - Professional...
You can download Adobe Illustrator for Mac as a part of Creative Cloud for only $20.99/month (or $9.99/month if you have also purchased an earlier software version). Adobe Illustrator for Mac is the... Read more
Delivery Status 6.3 - Check delivery sta...
Delivery Status displays delivery status of packages for a variety of shipment services. Can't wait for your packages to arrive? Don't waste your time checking the site constantly, just open this all... Read more
Garmin Express 7.0.0.0 - Manage your Gar...
Garmin Express is your essential tool for managing your Garmin devices. Update maps, golf courses and device software. You can even register your device. Update maps Update software Register your... Read more
ClipGrab 3.8.12 - Download videos from Y...
ClipGrab is a free downloader and converter for YouTube, Vimeo, Facebook and many other online video sites. It converts downloaded videos to MPEG4, MP3 or other formats in just one easy step Version... Read more
VMware Fusion 11.5.5 - Run Windows apps...
VMware Fusion and Fusion Pro - virtualization software for running Windows, Linux, and other systems on a Mac without rebooting. The latest version includes full support for Windows 10, macOS Mojave... Read more
Civilization VI 1.3.0 - Next iteration o...
Civilization® VI is the award-winning experience. Expand your empire across the map, advance your culture, and compete against history’s greatest leaders to build a civilization that will stand the... Read more
Google Earth 7.3.3.7721 - View and contr...
Google Earth gives you a wealth of imagery and geographic information. Explore destinations like Maui and Paris, or browse content from Wikipedia, National Geographic, and more. Google Earth combines... Read more
Corel Painter 20.1.0.285 - Digital art s...
Corel Painter lets you advance your digital art style with painted textures, subtle glazing brushwork, interactive gradients, and realistic Natural-Media. Easily transition from traditional to... Read more
iTubeDownloader 6.5.19 - Easily download...
iTubeDownloader is a powerful-yet-simple YouTube downloader for the masses. Because it contains a proprietary browser, you can browse YouTube like you normally would. When you see something you want... Read more
OmniFocus 3.8 - GTD task manager with iO...
OmniFocus is an organizer app. It uses projects to organize tasks naturally, and then add tags to organize across projects. Easily enter tasks when you’re on the go, and process them when you have... Read more

Latest Forum Discussions

See All

Using your phone in a protest
I can't write about games today. There is a struggle happening in the streets right now and it needs everyone's attention. Here's some good info on how you can use your iOS device safely amidst a protest. | Read more »
Dungonian is a card-based dungeon crawle...
Dungonian is a card-based dungeon crawler from developer SandFish Games that only recently launched as a free-to-play title. It offers an extensive roster of playable heroes to collect and enemies to take down, and it's available right now for iOS... | Read more »
Steam Link Spotlight - Signs of the Sojo...
Steam Link Spotlight is a feature where we look at PC games that play exceptionally well using the Steam Link app. Our last entry was XCOM: Chimera Squad. Read about how it plays using Steam Link's new mouse and keyboard support over here. | Read more »
Steampunk Tower 2, DreamGate's sequ...
Steampunk Tower 2 is a DreamGate's follow up to their previous tower defence game. It's available now for both iOS and Android as a free-to-play title and will see players defending their lone base by kitting it out with a variety of turrets. [... | Read more »
Clash Royale: The Road to Legendary Aren...
Supercell recently celebrated its 10th anniversary and their best title, Clash Royale, is as good as it's ever been. Even for lapsed players, returning to the game is as easy as can be. If you want to join us in picking the game back up, we've put... | Read more »
Pokemon Go Fest 2020 will be a virtual e...
Niantic has announced that Pokemon Go Fest will still take place this year although understandably it won't be a physical event. Instead, it will become a virtual celebration and is set to be held on 25th and 26th July. [Read more] | Read more »
Marvel Future Fight's major May upd...
Marvel Future Fight's latest update has now landed, and it sounds like a big one. The focus this time around is on Marvel's Guardians of the Galaxy, and it introduces all-new characters, quests, and uniforms for players to collect. [Read more] | Read more »
SINoALICE, Yoko Taro and Pokelabo's...
Yoko Taro and developer Pokelabo's SINoALICE has now opened for pre-registration over on the App Store. It's already amassed 1.5 million Android pre-registrations, and it's currently slated to launch on July 1st. [Read more] | Read more »
Masketeers: Idle Has Fallen's lates...
Masketeers: Idle Has Fallen is the latest endeavour from Appxplore, the folks behind Crab War, Thor: War of Tapnarok and Light A Way. It's an idle RPG that's currently available for Android in Early Access and will head to iOS at a later date. [... | Read more »
Evil Hunter Tycoon celebrates 2 million...
Evil Hunter Tycoon has proved to be quite the hit since launching back in March, with its most recent milestone being 2 million downloads. To celebrate the achievement, developer Super Planet has released a new updated called Darkness' Front Yard... | Read more »

Price Scanner via MacPrices.net

Sale! $200 off on select 2020 13″ MacBook Pro...
Amazon has select 2020 13″ MacBook Pro configurations on sale today for $200 off Apple’s MSRP. Shipping is free. Be sure to purchase the MacBook Pro from Amazon, rather than a third-party seller, and... Read more
June 1 only: $100 off Apple’s iPhones at Boos...
Boost Mobile is offering Apple iPhone 11, 11 Pro, and iPhone 11 Pro Max models for $100 off MSRP with service. Their discount reduces the cost of an iPhone 11/64GB to $599, iPhone 11 Pro to $899 for... Read more
Sams Club Sales Event: $100 off every Apple W...
Sams Club is discounting all Apple Watch Series 5 models by $100 off Apple’s MSRP through June 3, 2020. Choose free shipping or free local store pickup (if available). Sale prices for online orders... Read more
New 16″ MacBook Pros now on sale for up to $2...
Apple reseller DataVision is now offering new 16″ Apple MacBook Pros for up to $255 off MSRP, each including free shipping. Prices start at $2194. DataVision charges sales tax for NY, NJ, PA, and CA... Read more
Apple now offering Certified Refurbished iPho...
Apple is now offering Certified Refurbished iPhone Xr models in the refurbished section of their online store starting at $499. Each iPhone comes with Apple’s standard one-year warranty, ships free,... Read more
Sale! Get a 10.2″ 32GB WiFi iPad for only $27...
Walmart has new 10.2″ 32GB WiFi iPads on sale for $50 off Apple’s MSRP, only $279. These are the same iPads sold by Apple in their retail and online stores. Be sure to select Walmart as the seller... Read more
Apple resellers offer new 2020 Mac minis for...
Apple resellers are offering new 2020 Mac minis for up to $50 off Apple’s MSRP with prices available starting at $759. Shipping is free: (1) B&H Photo: – 2020 4-Core Mac mini: $759 $40 off MSRP... Read more
Sprint is offering the Apple iPhone 11 free t...
Did you miss out on Sprint’s recent free iPhone SE promotion? No worries. Sprint has the 64GB iPhone 11 available for $0 per month for new lines when you trade-in a qualifying phone in any condition... Read more
Apple has clearance 2019 13″ 1.4GHz MacBook P...
Apple has Certified Refurbished 2019 13″ 1.4GHz 4-Core Touch Bar MacBook Pros available today starting at $979 and up to $440 off original MSRP. Apple’s one-year warranty is included, shipping is... Read more
Apple restocks 2019 MacBook Airs starting at...
Apple has clearance, Certified Refurbished, 2019 13″ MacBook Airs available again starting at $779. Each MacBook features a new outer case, comes with a standard Apple one-year warranty, and is... Read more

Jobs Board

*Apple* Mac Desktop Support - Global Dimensi...
…Operate and support an Active Directory (AD) server-client environment for all Apple devices operating on the BUMED network + Leverage necessary industry enterprise Read more
Surgical Technologist III, *Apple* Hill Sur...
Surgical Technologist III, Apple Hill Surgical Center - Full Time Tracking Code D5.29.2020 Job Description Surgical Technologist III Apple Hill Surgical Center Read more
Security Officer - *Apple* Store - NANA (Un...
**Security Officer \- Apple Store** **Description** About NMS Built on a culture of safety and integrity, NMSdelivers award\-winning, integrated support services to Read more
Transition Into Practice Program (TIP) - Sept...
…Academy-Transition into Practice (TIP) Residency program at St Mary Medical Center in Apple Valley, CA. **We are seekingRegistered Nurses who are:** + New graduate Read more
Essbase Developer - *Apple* - Theorem, LLC...
Job Summary Apple is seeking an experienced, detail-minded Essbase developer to join our worldwide business development and strategy team. If you are someone who Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.