Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!SIERRA.BERKELEY.EDU!siegman From: siegman@SIERRA.BERKELEY.EDU ("Anthony E. Siegman") Newsgroups: comp.sys.mac Subject: Easy to Learn Mac Programming Environment Message-ID: <8805240408.AA01675@ucbvax.Berkeley.EDU> Date: 24 May 88 04:04:48 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 85 This is one of those messages that will get me laughed at by ``real programmers'', but what the hell . . . There's continuing discussion of the best programming environment for developing Macintosh applications, with MPW among the most widely favored for obvious reasons. What I want to point out here are the substantial, and largely unrecognized, advantages in terms of --utility --simplicity --and most especially, speed of learning of using Microsoft BASIC (!) as a programming environment for developing real and genuinely ``Mac-ish'' (though maybe not too complex) applications for the Macintosh. To start with, for those of you who haven't looked at a modern BASIC lately, MS BASIC has --no line numbers --unlimited length variable names and labels (at no cost in speed) --all the standard structured programming constructs --interpreter or compiler from the same source --subprograms with local variables and parameter lists (in and out) --pretty nice built-in editor --easy screen graphics and so on. You still have to be careful about variable types, and remember that all variables are global in the main program; but your program design can be as structured as you want to it to be (and a lot easier to read than any other language). Beyond that, all of the following Macintosh interface capabilities are directly and easily available as built-in commands from within basic BASIC: --Windows (4 types, 4 levels) --Menus (full capabilities) --Mouse (full capabilities) --Buttons (all types) --Edit fields --SFGetFile (for opening or saving files) --A very large fraction of QuickDraw capabilities --Numerous Mac ROM routines --Clipboard access, in and out, text or pictures --Event driven programming (using trapping or polling), for Timer, Mouse, Menu, or Dialog events. In brief, you can make a BASIC program that looks every bit as Mac-ish as you like -- and compile it immediately into a free-standing clickable application. Beyond this, once you learn a little about resources and how to duplicate or create them using REdit or ResEdit, by calling a set of very easy to use and syntactically very readable ``ToolLib'' library calls, which come packaged with BASIC, you can very simply create, access and use a very large set of Mac resources and Toolbox capabilities, including Arrays Clipping Alerts Modal Dialogs Graphics Icons Menus Mouse commands Patterns Pictures Points Polygons Regions Resource Files Scrolling Strings Text Windows In each of these cases, the Toollib calls look very much like the corresponding Toolbox calls in ``Inside Macintosh'', but most of these capabilities can simply be used; nearly all of the initialization and clean up hassles are largely avoided. Essentially every aspect of the official Mac interface is available in this way, along with callable library interfaces to VideoWorks and other programs. And again, when you're finished you can have a self-contained clickable application, with its own resources, icon, ``About'' box, and so on. The canonical statement heard from real Mac programmers seems to be something like , ``I spent 9 months reading all 5 volumes of Inside Macintosh, and struggling with MPW; finally I got the picture and could start doing things.'' My experience with a class I'm teaching right now is that interested undergrads with ``high-school BASIC'' backgrounds can start producing simple but real Mac applications within a few _weeks_ of beginning programming on the Mac. I'm not saying that I or anyone else would want to write a multi-featured paint program or text editor or something similarly sophisticated in MS BASIC. But if you're a scientist, or engineer, or high-school teacher or an amateur prgrammer in any field, who has other responsibilities in life besides Mac programming; and if you'd like to write a real Mac application with a real Macintosh interface for your class or your job or your personal use, doing it in MS BASIC is the only sensible choice I'm aware of. You can spend months to become capable in MPW -- or weeks with BASIC. Finally, might just note that it's our experience -- don't want to push this claim too hard, however -- that a compiled BASIC number crunching program (a big simplex program, for example, or an FFT) runs every bit as fast in compiled BASIC as the same program in any of the standard Pascals.