|Column Tag:||Tools of the Trade
By Dave Kelly, MacTutor Editorial Board
So you wanna be a developer, eh?
Software is big business. Just take a look in your junk mail each week, not to mention the advertising in MacWeek, MacUser, and MacWorld. Everybody wants to get into the act especially when there is a buck to be made. Sometimes the pomposity of the mainstream software products makes the task of developing a product overwhelmingly complicated. The message here is: YOU CAN DO IT, TOO! The best part is you can have some help too.
MacTutor is often asked by new Macintosh users and developers what they should do to get started in learning to program the Macintosh. Some of you dont really care about selling your own product, but just want to enjoy programming for the sake of programming. Programming is fun so why not?
What should new Macintosh programmers do to get started? Its really not that tough to get started, its finishing that is the tough part. Lets get started at least. Here is my list of things that will help you get going (not necessarily in this order):
GET A PLAN - Youve got to know what you want to accomplish. Individual goals may vary from learning how to program to developing a product to market. Write your plan down! If you intent to have a marketable product then you should write a Business Plan. You may need one anyway to either get funding for your project or to get support from Apple or 3rd party vendors. They will want to know that you are legitimate and serious before getting involved with you. A Business Plan will help you get on track and focused on your project. Nolo press has some great books to help you start a business, including a book on how to write a business plan.
Your plan should include elements of the other points I mention here. You should know what your product will do and who will use it. You should have some idea about how you will sell it and how you will support it.
GET INSIDE MACINTOSH AND HUMAN INTERFACE GUIDELINES - No matter what environment you will pick to program in, you will need to get yourself copies of Apples standard for Macintosh programming: Inside Macintosh and Human Interface Guidelines. These are available through bookstores or APDA (Apple Programmers and Developers Association). Get these even if you dont have a Macintosh yet. You should start with Inside Macintosh volumes I-III. This is an absolute must!! You will not be able to write software that Macintosh users will want to use, unless you follow these guidelines and properly use the ROM routines built into every Macintosh.
CHOOSE A DEVELOPMENT ENVIRONMENT - This may be one of the easiest or toughest decisions you have to make. Its important to pick the right environment for the product that you have. You should pick an environment that you feel comfortable with. You should keep in mind what attitude is portrayed by the development environment. Developers and users have varying opinions of each environment. I have summarized a few of the most popular environments and who I feel is using each type. (If I didnt mention your favorite it doesnt mean it isnt important. There are too many environments to mention them all)
BASIC - Basic is not usually considered a serious development environment although some commercial software being sold today was written in Basic. Most of these are specialized use products that were written by people who are experts in their own field but not fluent in any other programming language. Beginners often start out with Basic because it is easy to use. On the Macintosh, Basic is considered limited and most Basic products have not kept up to date with the latest Apple System Software. Although I havent tested any of the Basic products with System 7.0, Apples compatibility list indicates that Microsoft QuickBasic wont work with 7.0. ZBasic is still the best Basic available, but Zedcor makes more money on other commercial products, so the long awaited update to ZBasic 5.0 still has not materialized.
HYPERCARD/SUPERCARD - Today HyperCard is the most popular beginner environment. Since HyperCard is included with every new Macintosh thats not too surprising. Many developers have rejected HyperCard as a serious development platform because it has been thought of as a beginner environment and not powerful enough to do everything that other serious environments provide. Many of these limitations have been overcome with version 2.0 and the many XCMD and XFCN products that extend the capabilities of HyperCard.
Developers are beginning to reconsider their opinion of HyperCard now that you can program HyperCard menus, windows, etc. to follow Apples Human Interface Guidelines. HyperCard should be considered more often than it is for educational and tutorial software.
SuperCard has its advantages and disadvantages just as HyperCard does. The biggest disadvantage is that it doesnt have the following that HyperCard does simply because Apple doesnt give SuperCard away with every new Macintosh. Unlike HyperCard, double-clickable applications can be created from SuperCard projects. We havent heard the last of SuperCard.
MULTIMEDIA/AUTHORING SYSTEMS - These are not often thought of as developer tools because of their widespread use in making audio/video presentations. In some cases, this may be the ideal environment for your project. Since Macromind Director and others include interactive capability, your program (i.e. presentation) can now be enhanced with animation and graphics too. These come at a price though. Macromind Director 3.0 comes at $895 plus a fee for distribution of your commercial product. The problem is that the costs of conventional audio/video productions are much higher than when using a product like Director. This drives the price higher. If they can get it, thats what theyll charge and they do. Upgrades arent cheap either at $195. Price gouging at its finest!
The alternatives may be your best bet. Take a look at ADDMotion in last months MacTutor. Motion Works plans an animation product that can be used with nearly any environment.
PASCAL - This is the environment that serious Macintosh programmers should start with unless they have had previous experience in C. Because Pascal is a structured language a beginner will be more likely to write better built modular code than if he/she used Basic or HyperCard. There are currently two Pascal environments available, MPW Pascal and THINKs Pascal from Symantec. MPW would cost you $150 for the MPW system and another $150 for Pascal. THINK Pascal 3.0 is $249. The MPW system 3.1 is much more complex and may be confusing for beginners to understand. I prefer THINK Pascal because of the ability to run your programs from within the THINK environment. Symantec has kept up very will with System upgrades. MPW will allow you to add C for $150 or C++ for $175 if you later want to program in C.
If you want just enough Pascal to get you started, Symantec has a product that has been out since the introduction of THINK Pascal version 2.0 a few years ago. The product Just Enough Pascal (JEP) is a self paced course introducing you to programming with THINK Pascal and the Macintosh ROM routines. Although the product is still version 1.0, a 13 page manual is included to explain how to use JEP with THINK Pascal 3.0. Most of the differences are cosmetic since Pascal 3.0 changed a few of the menus around.
JEP consists of a desk accessory and source code for the tutorial. It is designed so that you can open your Pascal application and JEP at the same time. The JEP DA then takes you through the development of a Macintosh application. Each lesson is divided into 20 stages of the development. You can start out at any stage (the source code for each stage is provided). Each stage teaches a new concept in Pascal programming and at the same time gets you familiar with using Macintosh ROM Calls.
During a stage of the development of the sample project, you are directed to modify the source code from previous stages to add more functionality. You can copy and paste the new code directly from the JEP DA into your open source code. An explanation is provided and suggestions for Tinkering around with the code. The tinkering is where you have a chance to try things out and just see what happens. JEP is a great way to get started at your own pace.
C - C is the most popular of all languages for serious programmers. A side benefit is that if you know C you can get a job anywhere. C programmers are in very high demand. THINK C is very popular, but many people use MPW C too. C is more cryptic to a beginner, although some C programmers would recommend that beginners start with C right from the beginning. I would advise that you get a good C programming book and work through that before getting into programming using Macintosh ROM calls.
A great way to start with any of these languages is to attend Apple Developer University if you can afford the approx. $1000 tuition. OR you can order developer training on CD from APDA. The Macintosh Programming Fundamentals Self-Paced Training Course for $595 covers the fundamentals of vol. 1 of Inside Macintosh using THINK C as the programming environment. Other courses are available, too.
GET SOME HELP - No matter what your level of experience is, there will be times when you need help. If you are a serious developer then you should become an Apple Partner or Associate. Unless your problems are in need of Apples daily or weekly attention, the Associates program may be the best for you. For $350 a year you get sample code, Developer CD series, AppleLink, develop the Apple Technical Journal, Developer mailings, Hardware Purchasing Privileges, System software updates, invitation to the Worldwide Developers Conference, and more. For $600 per year you can be a Partner and have all of the Associates Program services plus Apple Developer Technical Support.
MacTutor fits in here as your best non-Apple sponsored source of developer information. MacTutor continues to provide informative columns each month.
BE CERTAIN THAT YOUR APPLICATION IS 7.0 FRIENDLY - There are three degrees of 7.0 compatibility. Applications can be 7.0 compatible, 7.0 friendly, or 7.0 dependent. At a bare minimum your application should be 7.0 compatible. That means that the application runs exactly the same as it does in earlier system software. It is absolutely necessary to be sure that your application is at least 7.0 compatible. Its even better to be 7.0 friendly. 7.0 friendly applications will still run under older system software, but will take advantage of special features that system 7.0 provides. 7.0 dependent applications depend entirely on the special features of 7.0 and wont run on earlier applications. If you write software that is dependent, be sure that the application doesnt just bomb under older systems, but that a message gets displayed telling the user that 7.0 is required.
Software that followed the guidelines of Inside Macintosh is most likely to be 7.0 compatible. In particular, you should let the ROM routines handle things whenever possible. Use the Toolbox routines to access low-memory global variables. If a routine that you are using is not available with all systems, then be sure to test to determine if it is available. (See Inside Macintosh, Volume VI for Compatibility Guidelines, also see Technical Note 2 and 117).
In my opinion, you should try to implement as many 7.0 friendly features as possible. For example, hide the clipboard when your application is switched out. Another application may also have a clipboard window open and just the front application will have the most current information. Allow font sizes greater than 127. Implement Balloon Help. Be sure that your application works when shared over AppleShare networks. This may be a lot of extra work to do, but in the end it will pay. It kind of gripes me when I see developers claiming that their product is compatible when it actually is slightly less functional in System 7.0. The opposite is true also, where the developer claims that you need to upgrade just for the sake of upgrading, not because the earlier version wont work.
If you wonder at what point you will be ready for MacTutor, I recommend that you start now with the "Best of" volumes of MacTutor. The very first articles that MacTutor printed explained aspects of the Mac toolbox for programmers that were then just starting out. It doesnt take long to work your way up to a level of understanding MacTutor. Read the columns written for other languages, they have explanations that are fundamental to the subject being explained irrespective of the programming language. Many people forget this and miss out on a lot of interesting information. Stay with it and dont miss more information in future issues of MacTutor
Just Enough Pascal is available from:
10201 Torre Avenue
Cupertino, CA. 95014-2132.
Phone: 800-441-7234 or 408-252-3570
Requires: THINKs Lightspeed Pascal v 2.0 or greater, Macintosh Plus or better, System Software 5.0 or newer. A Hard disk is strongly recommended.
Not copy protected!
Other products listed here are available from:
Apple Computer, Inc.
20525 Mariani Ave., M/S 33-G
Cupertino, CA. 95014-6299 USA
USA toll-free 800-282-2732
Canada toll-free: 800-637-0029
For more information on Associates and Partners Programs:
Attn: Developer Programs
Apple Computer, Inc.
20525 Mariani Avenue, M/S 75-2C
Cupertino, CA. 95014
or Call the Developer Hotline at 408-974-4897