Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesMac Programming Power Tools


April 1994 / Reviews / Mac Programming Power Tools

Mainstay's VIP-C and VIP-BASIC can speed applications development for novice and experienced programmers alike

Raymond Ga Cote

VIP-C and VIP-BASIC are a pair of Macintosh development tools that fit no single product category. Priced at $495 and $295, respectively, the two products provide complete structured-development environments for the C and BASIC languages. Because the VIP packages supply so many features not found in competing products, I found myself constantly redefining the programs as each new feature or capability popped up.

On first use, the VIP packages struck me chiefly as being structured editors. You create an application as a project, with each function a separate entry in the project window and all variables, type definitions, and macros in separate subwindows for easy track ing and definition. However, VIP-C and VIP-BASIC also include resource editors, an optimizing language interpreter, and a debugger. What's more, both packages can interface to external compilers (e.g., Symantec C and Microsoft QuickBasic) and also import ASCII text files into a project for reverse engineering.

VIP stands for visual interactive programming. This name, and a casual reading of Mainstay's marketing literature, might lead you to believe this is some form of CASE tool. Although both VIP products produce excellent flowcharts that help you decipher how your code behaves, they are really not CASE tools, because you can't edit the diagrams themselves.

I spent most of my review time with VIP-C. When I did switch over to VIP-BASIC, I found it to be an almost exact duplicate of the VIP-C application except for the actual language supported: BASIC rather than C. Everything else, including the ability to design interfaces, debug applications, and build stand-alone applications, is identical. I will use just plain VIP when I mean both applications, and though most of my examples will refer to VIP-C, you can assume they also apply to the VIP-BASIC environment.

Structured Editing

More than anything else, VIP is a structured editor, which can be both good and bad. On the positive side, a structured editor can guide you through program development by automatically inserting program constructs (e.g., if, while, switch, and do) and checking your syntax on the fly. While these features are useful for the novice, or at least for a programmer new to a particular environment, they can annoy an experienced programmer who is also a good typist. Development tools should make programming easier, not get in the way.

VIP walks that thin line between guidance and annoyance. Every time you enter a new line of code, it checks your syntax and updates the accompanying flowchart. If you find syntax error messages derailing your train of thought while you're entering large amounts of code, you can tempor arily disable these features. However, you may not need to. On a Mac IIci, I found that syntax checking and flowchart updating were sufficiently quick as to be unnoticeable.

VIP conveniently lets you access all your routines from a single project window. You can switch the display from an alphabetical list of routines to a diagrammatic function-call display that shows how the routines relate to each other. For easy reference, VIP also maintains a complete set of global types, macro definitions, global variables, and resource constants for each project.

VIP-C lets you enter standard ANSI C code as you would with a normal editor, but you must enter definitions of all variables, macros, and types through a special dialog box. While this approach ensures that you create definitions properly and provides the interpreter with information it needs, it is also tedious to enter the dozens of variables when you're initially creating the code. However, what I like least about Mainstay's approach is that yo u can't add explanatory documentation to the defined value. In the example shown in the screen shot on page 199, it would be useful to describe the dialog box for which I am defining the pointer.

With VIP, you can add dated notes to a routine or a project. These notes to be seem designed mostly for maintaining the change history of a routine, since they are displayed in chronological order. A similar feature for definitions would greatly increase the product's usability.

The VIP structured-editor approach shines because it provides prototypes for all 500 of its built-in functions, for the complete interface to the Macintosh Toolbox contained in Inside Macintosh volumes I through VI, and for all the functions you define in your own application. VIP displays a routine prototype in one window and a template for editing the prototype in a second window.

Templates are convenient if you don't use a particular call often or if you need to verify how you have defined a routine. If you can't remem ber a routine's exact name, you can type in a fragment of the name in the Find dialog box and it will list all routines that contain that fragment. For example, to find SFGet-FilePrev, I entered "sf" as the search parameter. VIP returned two dozen functions, ranging from the complete set of standard file routines to bit-map transformations.

VIP also features a palette that contains sets of frequently used functions. You access this palette by clicking on the small triangle that marks the current line in the edit window. The palette window comes up with 24 small icons, behind each of which is a list of related function calls. You can add and delete items in each palette list and even modify the icons shown on the palette.

The one item that is lacking from the function templates is the same thing that is lacking from the variable definitions--documentation. Even a one- or two-line function description would help. As it is, you must resort to the written documentation, and that makes the template f eature less valuable than it could be.

Besides providing complete access to all standard Macintosh Toolbox calls, VIP includes a set of higher-level library functions (see the table on page 204) that simplify Toolbox access and the creation of some relatively complex applications. For example, initiating and using an AppleTalk network socket becomes a matter of just two or three calls. As another example, the Grid library provides a simple interface to the Mac's 2-D list manager--something that interface builders such as AppMaker don't support.

Dispatcher and Resources

I found VIP's interactive interface designer to be its most useful feature. The combination of a simple interface builder, an even simpler application framework (which Mainstay calls Dispatcher), and the ability to immediately test the live environment is unbeatable.

Dispatcher is one of the simplest application frameworks you could ever hope to use. It is basically a central switching point for events moving from menus, to dialog boxes, to windows, to code. Since it has less than two dozen interface calls, you'll feel comfortable with it after just a few hours of experience.

Although you don't need to use Dispatcher in developing an application, doing so allows you to immediately attach your code to dialog boxes, controls, and menus. With this capability, you can quickly generate applications and test them in a live situation.

The resource editor itself is flexible and provides functionality not available in other interface builders. In defining a menu, for example, you can set menu-item colors, define an arbitrary marking character, and provide an icon on the item line. At the bottom right of the definition dialog box, you can see the routine that is executed whenever the menu item is selected. You change it by simply pressing the routine button and selecting another function. Similar capabilities exist for window and dialog-box designs.

Interpreting and Debugging

VIP's interpreter checks all code f or syntactical correctness and parses it into an intermediate language as soon as you enter it. It interprets this intermediate language when you run the application. You can also build stand-alone applications that use the interpreter, thereby ensuring that your final applications run precisely the same code as they do in your development environment.

An interpretive environment has certain advantages over a compiler--even an incremental compiler. One advantage is that the interpreter usually maintains a lot of information for decoding and displaying complex data structures. Another advantage is the ability to use #if macro commands to selectively activate particular routines without having to recompile the entire project. In effect, the macro construct #if or #ifdef becomes just another interpreter command. The VIP interpretive environment also ensures that programs don't exceed defined array bounds.

The built-in source-level debugger is simple to use and lets you step through your application , set breakpoints, and observe variables and structure values. It also contains several advanced features, such as the abilities to continue execution until a Boolean expression is true, alter variable contents, and continue execution until the program returns from the current function.

Although you can always expect an interpreted application to run more slowly than a fully compiled application, I found no significant speed differences with the VIP applications I built. Of course, you will get different results if you are performing serious numerical computations or spending a lot of time in code created within VIP-C, as opposed to calling the Toolbox.

Exports and Imports

VIP produces stand-alone applications without additional tools, but there are times when you simply want the speed of a compiled application. By working with third-party compilers, VIP lets you take advantage of compiler speeds in your final executable file while still maintaining the flexibility of an integrated environmen t.

Most simply, you can export an entire VIP-C or VIP-BASIC project to a standard ASCII file and run it through a compiler. VIP-C exports are compatible with Symantec's Think C, Apple's MPW C, and Metrowerks' CodeWarrior C compiler. VIP-BASIC exports will work with Microsoft QuickBasic. Exports generally appear as a single monolithic ASCII text file, which makes it a little difficult to navigate through for follow-up editing. However, the export files' clean layout makes them very readable.

VIP-C provides the optional ability to link to Symantec Think C 6.0 and Apple's MPW C through the use of AppleScripts, using ToolServer to completely automate the process of creating, compiling, and linking an externally compiled application. I did not test the MPW C link, but I did successfully send several sample applications to Think C 6.0.

Aside from your having to ensure that several original and well-documented files are available for the build process, this last process is completely automated. All you need to do is select one menu entry to create the project, one menu entry to set all the project parameters (e.g., application creator ID and sizes), and then one last menu entry to actually build the application. You can even run the Think C debugger from the VIP-C environment to examine the newly compiled application.

The VIP documentation also states that you can import preexisting text files into an existing VIP project. Although this appears feasible in principle, it is not practical for any large amount of preexisting code. That's because VIP-C has difficulty finding and decoding all the myriad include files in a complex application.

In particular, VIP can't find header files in one directory that are used with source files in another directory. Mainstay acknowledges this problem and recommends that you use precompiled headers that you can then redefine in your VIP project. I opted not to do this because I did not want to change the source code for a currently active project.

Another problem with importing existing projects is size. Many of my ongoing projects have become quite large over the years. The thought of moving them into a single monolithic file is troublesome. According to Mainstay, this is not an issue with its current customers, who are mostly creating new applications, not importing old code.

For the Future

Operating environments are always changing, and the Mac is no exception. Mainstay plans to maintain the timeliness of its VIP-C and VIP-BASIC products with its VIP Extender utility. This program converts into VIP interfaces new Toolbox manager include files distributed by Apple. Since it converts only include files, you can use this utility to provide interfaces to new Toolbox functions but not to functions in third-party libraries.

VIP-C and VIP-BASIC provide a fully integrated development environment that can help novice and experienced programmers alike rapidly develop new applications. The three-pronged solution of framework, resource editor , and interpretive-language environment provides a powerful development tool. The VIP solution will not work for everyone, partly because of individual preferences. But VIP-C in particular is well worth considering as a front-end designer for your Think C and MPW C applications.

For my own applications, I plan to use VIP-C to create the initial user interface and basic functionality. Then I'll switch over to Metrowerks' C for the final development cycle, creating programs for both the original 680x0 platform and the latest PowerMac systems.


The Facts



VIP-C 1.0.2             $495
VIP-BASIC 1.0.1         $295
Mainstay
591-A Constitution Ave.
Camarillo, CA 93012
(805) 484-9400
fax: (805) 484-9428


VIP Function Libraries



A list of the specialized function libraries available within VIP-C, with a sampling of functions from each. Most are identical to functions found in VIP-BASIC. In addition to these, VIP-C also provides a complete set o
f ANSI-standard C libraries.


3-D GRAPHICS LIBRARY
_clip_3D_line
_pitch_3D
_skew_3D
_transform_3D


APPLETALK LIBRARY
_get_request
_lookup_entities
_open_socket
_send_response


COLORQUICKDRAW LIBRARY
_animate_palette
_is_real_color
_load_color_cursor
_pick_color


DIALOGS LIBRARY
_append_dialog_item
_do_alert
_set_dialog_event_proc
_set_item_update_proc


EVENTS LIBRARY
_dispatch
_get_key
_set_timeout
_still_down


FILES LIBRARY
_count_appl_files
_create_dir
_get_vol_space
_write_MacPaint_pict


GRAPHICS LIBRARY
_back_pattern
_diff_region
_draw_icon
_scroll_rect


GRID LIBRARY
_add_grid_columns
_draw_grid
_grid_event
_set_row_height


MATH LIBRARY
_angle_from_slope
_annuity
_binary_log
_fixed_divide


MENUS LIBRARY
_count_menu_items
_load_menu
_new_tear_off
_set_hierarchic_menu


PRINTING LIBRARY
_control_printer
_print_bits
_print_text
_set_print_options


RECORDS LIBRARY
_allocate_record
_get_field
_
memory_free
_set_record_size


RESOURCE LIBRARY
_count_res_types
_get_res_attrib
_get_resource
_set_res_scope


SOUND LIBRARY
_new_channel
_note_command
_play_tune
_set_voice


STRINGS LIBRARY
_append_character
_box_text
_match_pattern
_string_to_scrap


TEXTEDIT LIBRARY
_copy_text
_get_text_length
_search_text
_set_text_style


UTILITY
_bit_and
_get_date_string
_get_system_globals
_test_bit


WINDOWS LIBRARY
_clear_window
_get_screen
_load_window
_set_port_picture


Illustration: A typical VIP screen layout with an application in development. Shown are the VIP-C project window (lower right); a dialog window being designed (lower left); two routines, one in the form of a flowchart; and a local-variable definition.
Illustration: VIP-C templates provide easy reference to the parameters for infrequently used functions. The window at the top holds a routine prototype, and the bottom window holds a template for that routine , ready to be filled in.
Illustration: A menu-item definition dialog box allows you to set arbitrary marks, icons, and menu colors as well as link the menu item directly to an existing function. At the bottom right of the definition dialog box, you can see the routine that is executed whenever this menu item is selected.
Raymond GA Cote is a BYTE consulting editor and vice president of product development for Appropriate Solutions, Inc. (Peterborough, NH). He can be contacted on the Internet at rgacote@ world.std.com or on BIX as "rgacote."

Up to the Reviews section contentsGo to previous article: Multimedia PresentationsGo to next article: 57 PCs That Set The PaceSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM   C
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network