Additionally, since it does not use a proprietary programming language, it is one of the few palmtops on which you can get under the hood.
What I like about the HP Palmtop is that it can be programmed. Since the information is not available, as a mere mortal you cannot program on the PIM type machines. -- Gilles Kohl, software developer and engineer for PROCAD.
Portability is another big plus on the palmtop. Because the HP 100/200LXs are with you all the time, they make great machines for honing programming skills in spare moments. Whether you're sitting in a New York cafe or by a Carolina fireplace, it's always there when you want to use it.
It is always available for those spare moments of inspiration. Its x86 compatibility is well documented and almost every programming language has a compiler for it. -- Mark Scardina, a sysop on CompuServe's HPHAND forum.
Compilers turn programming code, which can be written in any text editor including Memo, into a program that can run on a computer. Compilers that run on the palmtop include Mix Power C (which Gilles recommends because it is inexpensive and comes with an excellent manual); Pacific C; Prolog and TIPI (a language by Kent Peterson that is a hybrid of Basic and Forth, see the Jan./Feb. 97 issue of The HP Palmtop Paper for more information). Other users have even claimed success with the reputedly buggy Visual Basic for DOS. Given this abundance of choices, which programming language or compiler do you pick?
If you polled the best programming minds at a large software developer like Microsoft, you would find a lot of different opinions about programming languages. Some programmers started on Logo, many on Basic and at least one or two who had fun with machine language while they were in diapers. Each one of these programmers is going to favor the language they know best, and have special strengths and weaknesses as a result of their learning path. -- Beverly Howard.
Which is the best programming language for the palmtop?
To "C" or not to "C" the biggest advantage associated with programming in the C language is that you have ready access to the Palmtop Application Library (PAL). PAL is a library of functions coded in C that allows you to create programs that have the look and feel of the HP's built-in functions. Programs such as the popular HV (an HTML viewer for the palmtop) and LXBatch (a batch file enhancer) were created with the help of the C functions contained in PAL (see the Mar/Apr 96 issue of The HP Palmtop Paper for more on PAL).
Those who want to be able to use PAL should bite the bullet and learn C. Ed Keefe, professor, programmer and author of PC in Your Pocket Best of The HP Palmtop Paper, (available from Thaddeus Computing).
Another reason why many programmers prefer C is that it is considered a more "pedal-to-the-metal" language. It offers greater control over your machine, and thus more speed and power.
The thing about C is that it is extremely flexible and powerful. That is why it is such an obvious choice. It is also considered difficult for novices. Unlike PASCAL, BASIC, (or for those of you who have looked at it, JAVA) C will let you do anything that you want, no matter how stupid it is. This can get you into trouble. Colin Cumming).
Start with PASCAL and Migrate to C
Many beginners might find C too difficult, and many programmers recommend that novices instead start with Pascal.
Pascal forces you to think in clear concepts. C is more flexible, but allows you to program spaghetti code; that is, it supports bad programming practices and strategies. Therefore, it is a good idea to start with PASCAL and then migrate to C. It is very easy to migrate from PASCAL to C and you will more likely write well-designed C code when going that way. Andreas Garzotto, author of many palmtop software products and principal of D&A Software Inc.
Keeping things BASIC
Basic continues to be one of the most popular programming languages ever. Many early IBM compatibles came with versions of Basic bundled with their hardware, such as GW-Basic or Basic-A. Most machines that came with DOS-5.0 or later came with a sophisticated version of Basic by Microsoft called Qbasic. Qbasic was hardly the Basic with which most of us grew up. Gone were the command line prompts and line numbers that turned most of us off of programming, back when we had machines such as the Tandy TRS-80. Qbasic even came with its own integrated development environment that offered such things as automatic correction of some basic syntax errors during the programming process.
I used to teach Basic in the MBASIC and BASICA days. I didn't like it, and jumped to Pascal when Borland introduced Turbo Pascal 1.0 (CP/M). Since then, Basic has grown up and is more like Pascal. I've taught myself VBA in Excel and like what I see. Ed Keefe.
One of the biggest advantages of programming in Basic can be summed up in one word: Microsoft. The Redmond, Washington-based company has been pushing the language for years, first as GW-Basic (the IBM version of Basic was known as BASIC-A), then later as Qbasic, which came bundled with machines. Microsoft also offered a commercial version called QuickBasic that offered programmers the capability to make their programs executable, (translating the code into machine language).
These days, Redmond's preferred version of Basic is known as Visual Basic, a rapid application development (RAD) environment which is said to have more than three million copies circulating. Visual Basic has become one of the most popular RAD environments for developing Windows-based applications. VB exists also in the form of Visual Basic for Applications, the development language now common not just to the Microsoft Office suite of programs such as Word, Excel, PowerPoint and Access, but also to non-Microsoft programs such as Visio, the drawing program.
Additionally, there is a flavor of Basic called VBScript, which can be used to create Web pages. Microsoft also supposedly has plans to allow programmers to write for Windows CE using Visual Basic. (Right now development for Windows CE is almost solely in C++). The programmer using QBasic or QuickBasic has the advantage of being familiar with the syntax that has since evolved to become Microsoft's Visual Basic.
Then there are also the shareware basic compilers for the PC world such as ASIC, Bywater Basic, LibertyBasic (supported by author Carl Rundel) and TSRBasic. One of the most popular compilers for the PC DOS world is FirstBasic n. Users interested in PowerBasic can download FirstBasic from CompuServe (GO POWERBASIC or GO HPHAND), or from PowerBasic's web page (www.powerbasic.com).
Another way of getting PowerBasic is to buy a copy of Learning Basic Book for DOS, which includes a copy of the PowerBasic 2.1 compiler for $29.95. More recent versions of PowerBasic are advertised as 99.9% compatible with Qbasic.
From personal experience, as someone who learned C programming in college, I prefer Basic because it is less intimidating. Writing code in Basic takes less time than it does in C (you don't have to worry about defining everything if you don't want to and you don't have to remember to put semi-colons after everything. Dave Navoro of PowerBasic, Inc.
Learning how to program
So you've picked a programming language, but now how do you learn how to program?
1. Read a good book Comb the shelves of your local library for beginners' books on programming. Bookstores are also good sources for these. Barnes & Noble often sell copies of QBasic for Dummies, Qbasic by Example, and Teach Yourself QBasic. The Revolutionary Guide to QBasic teaches more advanced techniques such as 3-D graphics, multimedia and even creating your own spreadsheet application. I was recently able to find a copy of Using Basic (published by Que) at CompUSA for the closeout price of $10. Of course, Thaddeus Computing offers such resources as the HP Developers Guide and PAL (Thaddeus Computing, 800-373-6114). Don't forget to check the Amazon web site for books on programming: www.amazon.com.
2. Get caught in the Web Most of the major programming languages
have dozens if not hundreds of Websites devoted to them. Basic continues
to be a popular programming language and there are lots of Web resources
for the beginning programmer. You can find freeware and shareware tutorials
for BASIC-related topics, such as:
3. Find a mentor Many experienced programmers agree that the best way to learn programming is at the foot a grizzled, experienced pro.
If possible do an apprenticeship with someone who already is highly productive in programming, or take a course at a college near you. If you're on your own, there are several good books that will teach structured programming and top-down-design, but most people need someone to guide them. Without a guide most self-taught programmers wind up repeating all the mistakes that other programmers have made. Ed Keefe.
Programming books are great, but it's better if you can discuss them with a mentor or some knowledgeable person. Play around with DOS batch files, little assembly routines and read the DOS manual. In other words, learn as much as you can about the machine your programming for. This may prove helpful in the future. Art Leather, an Independent Windows/ Psion Software Designer/Engineer.
It's best if you can find a real mentor someone who is knowledgeable, patient, and interested enough in you and your new pastime that he or she will want to help you develop your skills. If you know someone that fits that bill, fine. If you don't, don't worry. There are a number of good sources for this kind of help.
One of the most obvious sources is your online service CompuServe and America Online, for instance. Check out the programmer's section of CompuServe's HP Handhelds forum (GO HPHAND), the MS Basic forum (GO MSBASIC), the PC Programmers (GO PCPROG), and MS Languages forum (GO MSLANG). There are other programming-related forums on CompuServe, but these are good places to start. When you are stuck on questions about the best way to approach a problem, or just curious about where the best source of information about a programming language might be, these forums can be great resources. Generally, you will find that there are enough kind-hearted souls who remember what is was like when they themselves were novices that they will want to help you.
4. Just do it, and have fun! Several experienced HP Handheld programmers agree that one of the best ways to learn how to program is, well, to just start programming and have fun doing it.
TeamHP member Fred Kaufman, who works as a volunteer answering questions in the HPHAND forum, also recommends that beginners dabble with LXBatch n, a batch file enhancer with programming language functionality (See The HP Palmtop Paper, March/April 1996.) Pick achievable projects that you're interested in.
Get a project to work on, an idea you may have carried around for a while and start building it into a program. You want to keep your interest in programming at an all-time high, so do it slowly by wining in small bytes. A project isn't just one big win, it's a lot of little successes that build into a complete program. I can't wait to see the big picture, but I keep reminding myself that it's the little successes that build the bigger successes. Art Leather.
[Editors note: All the DOS freeware and shareware basic compilers mentioned in the article should work on the HP Palmtops, with the exception of the Mac and Windows compilers.
Also, the programming section of PC in Your Pocket - Best of The
HP Palmtop Paper (by Ed Keefe, and available from Thaddeus Computing, 800-373-6114)
discusses a number of built-in programming tools for the HP Palmtops, including
the Lotus 1-2-3 macro language, user keys/system macros, the subset language
in the database engine, DOSKEY (for DOS macros), HPCalc/Solver, the MS-DOS
batch language, and Debug script files.]