Acorn User


Pascal For Basic Programmers
By Addison-Wesley
BBC Model B

 
Published in Acorn User #042

No Fault For Pascal

Pascal For Basic Programmers

Both Basic and Pascal are computer languages which have been adapted well to microcomputers. Although similar in many ways both have marked differences, strengths and weaknesses. No doubt an extended, structured, Basic is the right language for beginners on microcomputers. (Do I hear cries of dismay from the structuralists?) It is ideal for small computers with a limited memory capacity since it can provide an immediate response to program changes - useful for the novice programmer. Pascal, however, offers both increased sophistication and power to everyday programming.

This book is totally orientated towards the reader who has a personal computer, is familiar with Basic and who wants to investigate the power, structure and convenience of Pascal.

It is a volume of five parts: first, there's a chapter that, with a suitable micro, will allow 'hands-on experience' with a subset of Pascal right away. Second, there is a simple discussion of the process of translating high level langauges into machine code (including the influence on the varieties of Pascal). Then there is a section on the practical aspects of programming followed by a description of the process of planning and writing a Pascal program (included here are two useful, illustrative programs). Finally, the book contains a most useful Basic to Pascal phrasebook.

The book compares Microsoft Basic and UCSD Pascal, both of which the authors state are "...the most popular forms for microcomputers".

The first chapter really gets the reader to grips with Pascal without throwing him/her into the deep end. By focussing on how the simplest programs are organised, the different approaches of the two languages to control statements are emphasised.

At a very simple level Pascal certainly seems more cumbersome and wordy than Basic, but the authors reveal the virtues of Pascal in the chapters which follow.

This introduction chapter is a real gem. It provides that most essential element for a newcomer: immediate understanding and success. After an evening spent typing in the simple examples given, I certainly had a clear idea of how Pascal is organised. Such is the clarity of the text, I found myself well motivated to read on to discover the various control statements, syntax and structure.

With the aid of so many concrete examples, transferring to Pascal is certainly far easier than I first anticipated. I began to accept that Pascal has many advantages over Microsoft Basic. As the book points out, it is superior for longer programs - it can organise them into semi-independent pieces. It doesn't simply encourage the programmer to write in a structured way... it makes him! The advantages are obvious: readability and easy debugging.

When Niklaus Wirth specified the original design of Pascal, he knew it would greatly enhance the value of the language if he could make it available for a number of different computers. The authors give detailed explanations of high level languages which are either interpreted or compiled into machine code and present them in a convincing argument for UCSD Pascal.

The remaining chapters explain in detail each aspect of the language from simple assignment statements through to procedure nesting. At each level copious examples are given to illustrate or extend points made in the text. The examples shift their emphasis progressively from Basic in the early stages to entirely Pascal in the latter.

The final section of the book compares MBasic (v5.2) with UCSD Pascal (v2.0). It is essentially a dictionary enabling programmers to quickly access the operation they require (in Basic) and then to find the equivalent operation in Pascal.

Frankly, it is difficult to fault Pascal For Basic Programmers. Clearly, Charles Seiter and Robert Weis have a considerable understanding of the learning process - the text is clear and carefully considered.

For any serious programmer wanting to take advantage of the discipline of Pascal, this book is an important step to successful application programs. Here is a practical, informative guide to learning to use that power.

Chris Drage