Scor­pio News

  

January–March 1987 – Volume 1. Issue 1











Page 47 of 63











‘A useful List of basic BASIC statements and commands ie given in Monro (1978) T don’t think that either of the usual PASCALs (Hi-Soft and COMPAS) give any Indication of which of thelr statements and commands are non-standard as fara! the 180 definition fe concerned, but Proepero’s Pro-Pascel aad ProFortran do, Te ta always « good idea to include in « REM or COMMENT statement, the version Of the language which you have used if tt ie not ehe ‘portable’ type.

‘A fabulous

development which £ program which ha bells and whisel 8 Dveryone will w ien’e going to inepire auch confidence if the Listi fe"cheldy, disorganized or poorly commented An incompletely commented progras:

ghe be all right if it works all the eime but wnat happens 1f you want to Bodify te Laver and you’ve forgotten why you put in particular bit of code. Are your variable oames sensible – it is helpful to use T for the sum of © Series of munbere and N for the total umber of observations – rather than Q oF Z’for example? Screen or printer output should be helpful – if you vant « Fesponse to a prompt on the screen, put in a few words to request the (nput = Such as “Womber of observations’ Similarly, results, whether on the screen oF Printer should have some explanaticn – auch as headings for columns.

vay of expressing the advantage of (for example} indenting parts of # progeam Listing – it was first used by Nagio. and Ledgard in 1978 0s 6 of pointing out the advantages (for following program Yogic) of various levels of Indentation caused by typing spacer statements – thus nested FOR. NEXT loops could be traced very e jecand and subsequent loops Were indented by 2 of 3 spaces COMAL does thi Automatically A tidy scresa or printer display of t fe more easily Understood and some ‘prettyprinting’ here is achieved by spaces or the use of tabs or particular print field descriptors The readability of @ listing is Inproved’by blank comment Lines in appropriate places.

‘Prettyprinting’ is a racher “ew

Documentation

For many people, particularly those not familiar with « program, adequate documentation is essential, so its provision is a major and often disliked part Of program developaent, “If a progeam ie for your own use, why bother? The trouble is that one’s menory is not faultless ands lot of time and temper cen be wasted, A good extmple of documentation is that provided with the various PEN programs – ‘well set out and comprehensible to the average dodo. We all know of bad examples!

Integrity

In an ideal world, our carefully written, wall-documented program would produce the right reaults from whatever data we stuffed into it’- er it would do in bther ways, what twas deeigned for- Unfortunately, this ie rarely the cate and even after extensive debugging, it may still refuse to function properly. A program should, once it hav been found to be error-free, both in teras of syntex {confusion of i and 1, 2 and Zor O and 0, for example or the wrong number of brackets) and the results obtained, be ‘error-trapped’ so that an incorrect or out-of-range input does not throw i into a state of utter confusion so that the Bachine crashes or an incorrect result is output” This takes a litle time to Organise but ie vell worthwhile. Test data may work perfectly but real data may produce odd results so one’s test data should, where possible, include valuer Tying at the ‘extremes which are Likely to be encountered. Commercial pach

afe variable in this ceapect – some ‘throw a wobbly’ if bad data are encoun but the majority are designed to cope with chit eventuality and allow some user= intervention to correct the situation efter the package bas produced an error message.


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 47 of 63