WHY NOT USE PL/I (regular post) 
Author Message
 WHY NOT USE PL/I (regular post)

                        Why you should consider using PL/I:

*  It is an easy language to use; the syntax is clean, and the rules are
uniform.  There are many built-in functions to assist.

*  It is a good first language, and provides an excellent growth
path for the professional.

*  PL/I can be used for solving a wide range of numerical problems in
virtually every sphere of the computing arena, be it mathematics,
engineering, science, medicine . . . etc

1. The best part of PL/I is the input and output.  You can rely on it.

   The input/output is achieved with statements that are ready to use,
   and easy to use.

   There's no setting up to do.  They are <b>not</b> procedures or functions
   dressed up to look like statements.

   In formatted output, you don't get silly numbers displayed when
   you include the format specification, but omit the name of the
   variable (e.g. C);  nor when you use the wrong format (e.g. I4
   with a fortran REAL variable).  PL/I converts to/from the type
   that you specify, be it integer, fixed-point, or string.
   You don't get silly things happening because you left off the
   "&" from the "scanf" function in C.  That's because the input
   operation (GET) is a statement, not a function.

   And when you want formatted output, you have a variety of formats
   that you can choose, such as PICTURE format, with drifting signs
   and drifting $ sign.  You can insert commas or spaces in very long
   numbers, to make the output readable (e.g. 123,456,789.356,251 is
   better than 123456789.356251).  You can use either PICTURE formats
   or the specific codes to get integer, decimal fixed-point, and
   floating-point outputs.

   And if you don't want to be bothered with formats, you can use
   simple free-formatted output, e.g. PUT (X);

2. For business applications, you can have decimal data, whereby
   data is stored exactly (e.g. 5.14 is stored EXACTLY, not as
   5.13999), and arithmetic operations give exact results
   (e.g. 3 x 5.14 gives you 15.42 precisely, not 15.41998)

3. Files are easy to use.  If you can do output to the screen, and input
   from the keyboard, you can do Input/Output to files, simply by inserting
   the file name into the GET or PUT statement thus:  GET FILE (MYDATA) etc.

   Outstanding and helpful PL/I facilities include:

1. The debugging facilities are all part of the language (for example,
   checking for subscript bound errors and string reference errors
   with SUBSCRIPTRANGE and STRINGRANGE etc are most helpful, along
   with appropriate ON statements to display the values of variables).

   The best part of this is that you can display everything you need
   (statement number, values of variables, a trace of procedure calls, etc)
   instead of those cryptic messages (from other languages) such as
   "floating-point trap" at some inidentified location somewhere in
   the program.  (When you've had this message in a 20,000 line program,
   you'll know what I mean!)

2. And if your program gets stuck in a loop, just hit CTRL-BREAK,
   and your ATTENTION ON-unit will tell you precisely which
   statement it's executing.  Not only that, it lets you do anything you want,
   including printing the values of all (or preselected) variables,
   and changing any or all of the values of variables.

   You don't have to re-run your program (with new output
   statements) to find out in which loop it's stuck! (and then run it
   yet again to display the values of variables you think you need).

   And if your program was running OK after all, you can resume
   execution again, as if nothing had happened.

3. The ability to intercept errors (via ON statements) and to
   <b>continue</b> execution;

4. The simple, handy I/O statements GET LIST, PUT LIST, along
   with the very handy PUT DATA statement (for debugging mostly).

5. Everything is "ready to go" unlike some other languages, such as Ada!

6. The "whole-array" operations simplify programming and increase under-
   standing, and increases execution speed into the bargain;
   If A and B are arrays, you can write A = B; to copy an array.  You
   can use PUT (A); to print an array. [these are trivial examples --
   more is available]

7. Dynamic arrays provide the means to write a general program for any
   size of array.  You aren't bound by some artificial limit.  You
   automatically obtain exactly the amount of storage you need for an
   array.

8. The COMPLEX data type is provided, which simplifies the preparation
   of programs because commonsense complex arithmetic is available.

   A number of essential functions is at hand for producing:  complex
   square root, the conjugate, the absolute value, and for extracting
   either the real or complex components, and for fabricating a complex
   number from two real numbers (SQRT, CONJG, ABS, REAL, IMAG, CPLX).  The
   ** operator is available for raising a complex number to a given power.
   A range of (complex) trigonometric functions is provided (includes
   SIN, COS, SINH, COSH, etc, and mathematical functions such as LOG).

   Even more importantly, debugging is simplified, because
   the error messages are specific to complex number operations.
   (If you have used complex arithmetic without using the COMPLEX
   facilities, the best that the error messages can tell you is in
   terms of real (floating-point) operations, which don't necessarily
   make sense).

   And the COMPLEX type can be applied to integer as well as to float-
   ing-point data.

9. PL/I has excellent string-handling facilities.  First, there
   are two types of string -- the fixed-length string and the
   varying-length string.  These two data types are supported by a
   range of functions that speed up string processing compared to
   other languages.  It isn't necessary to write your own "string-search"
   routines like you need to in other languages such as C and Pascal, for
   example.  The search functions are already there (INDEX, SEARCH, SEARCHR).
   What's more, if the machine has a "search" instruction, it can use that,
   and search faster than some hand code using a loop. (Having
   to write your own search routine is like having to turn out
   your own nuts and bolts on a machine lathe).

   PL/I can search from either the right-hand end or from the left-hand
   end of a string (SEARCH and SEARCHR)

   Joining strings is a simple operation (catenation); the length of
   a string can be discovered by using the LENGTH function; strings
   containing blanks (or any unwanted character) at the beginning
   or the end can be removed using the TRIM function.  Strings can
   be centered using the CENTER- built-in functions (helps with
   page headings etc) and so on.

   Other functions include TRANSLATE, for changing ASCII <==> EBCDIC,
   and for converting upper to lower case, or for replacing special codes
   such as TAB to blank or for any other conversion;
   and VERIFY, for performing a search, validating data etc.

10. A macro pre-processor is available on IBM mainframe PL/I (OS) and IBM
   OS/2 for the PC, and Liant OPEN PL/I, and probably others.

11. And when you need to do something special (rarely, but it's
   nice to know that you have something to fall back on in
   an emergency) it's there -- With UNSPEC you can peek at
   the bits of a data item (be it a character string, an
   integer, bit string, or floating-point data).

For further information about PL/I, systems, and suppliers, see:

http://www.*-*-*.com/

        IBM's PL/I home page

and

http://www.*-*-*.com/



Sat, 13 Nov 1999 03:00:00 GMT  
 WHY NOT USE PL/I (regular post)

You should remember that an idiot can write rubbish with any language, but
well
structured pl1 written to a simple set of standrards is elegant and
practically writes itself.

Cheers :)



Sat, 13 Nov 1999 03:00:00 GMT  
 WHY NOT USE PL/I (regular post)

PL/I is the first programming language learned, and today I appreciate PL/I
even more (since I know others, particularly C).

It's a petty that there is no object orientated PL/I.
And I never found out how to refer to strukture-lengths during the
precompile and compile phase. I mean it's not possible to initialise static
variables with lengths
The preprozessor and macrofacilities are not easy to handle. (I prefer in
C)

I mean it's a matter of personal tast, too.
But as an IBM-Hostie I adore PL/I and I'm wondering what folks like about
C.

Patrick Ogay



Sun, 14 Nov 1999 03:00:00 GMT  
 WHY NOT USE PL/I (regular post)


 > PL/I is the first programming language learned, and today I appreciate it
 > even more (since I know others, particularly C).
 >
 > It's a petty that there is no object orientated PL/I.

 ahhh...but there is an OO-PL/I (or soon will be). The friendly folks at
 IBM's Santa Teresa Labs, the home of PL/I, are busy at work adding OO
 extensions to PL/I. Peter Elderon gave a presentation of what it will
 look like at GUIDE last year in San Antonio, TX> I can post a copy of
 his presentation to the list, if there is enough interest. I'm sure
 the developers would love some user feedback on their approach.

 > And I never found out how to refer to strukture-lengths during the
 > precompile and compile phase. I mean it's not possible to initialise static
 > variables with lengths
 > The preprozessor and macrofacilities are not easy to handle. (I prefer
 > C)
 >
 I'm not sure what you mean here, Patrick. Could you give us an example?

 > I mean it's a matter of personal tast, too.
 > But as an IBM-Hostie I adore PL/I and I'm wondering what folks like about
 > C.
 For a very well written and rational comparison and contrast between
 PL/I and C, see Eberhard Sturm's page at:

   http://www.uni-muenster.de/URZ/Mitarbeiter/EberhardSturm/PL1andC.html

 After reading this, you'll wonder why C is used for anything anymore.
 >
 > Patrick Ogay
 >

Dave Jones



Sun, 14 Nov 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Why not use PL/I ? (regular post)

2. Why *not* use PL/I (regular post)

3. Why *not* use PL/I? -- (regular posting)

4. What is PL/I (regular post)

5. What is PL/I? -- (regular post)

6. Why not use PL/I?

7. Why _not_ use PL/I?

8. Why not use PL/I ?

9. Why not try PL/I ?

10. post-optimizing inline assembly : why not !?

11. It's not PL/1, it's PL/I

12. It's not PL/1, it's PL/I

 

 
Powered by phpBB® Forum Software