Forgot your password?
typodupeerror

Comment Re:PL/I - Features Vs. Control (Score 1) 315

I do a fair bit of work in a IBM mainframe environment, and I use PL/I as the language of choice. When your choices are COBOL or PL/I, well, it's not hard to pick PL/I. I guess that I've been using it for so long that I don't really notice the complexities anymore.
In fact 3 languages have this sort of distincction, PL/I (worst because of the large number of special cases, just look at the rules for type conversions, it is far from straigthforward to determine what the implicit type conversions are)
Yes, but how much do you have to think about the details of the type conversions? Most of the time you deal with a small subset of possible data types and you don't do type conversions. For those of you who haven't run into PL/I, the designers decided to avoid types such as "integer" and "real" numbers. When you declare a numeric field, you indicate how many binary or decimal digits you want in the number. For example, you declare a variable with 5 decimal digits, or a variable with 10 binary digits. In addition, you can specify when you want a fixed or floating decimal point. A short integer (15 binary digits, plus one sign digit) would be declared as "fixed binary(15)". A full-word integer would be "fixed binary(31)". This also shows one of the problems of the approach; although in theory the declarations are machine-independent, programmers chose variable types that were tied to the underlying hardware. I remember reading once that one of the reasons why Multics wasn't easily ported to other systems was because the PL/I code used a lot of "fixed bin(35)" and "fixed bin(17)" variables, which tied it to the 9-bits-per-byte hardware.

Since you specified exactly how many digits (decimal or binary) a variable would have, there was a complex set of rules needed to convert one type to another to avoid loss of precision. However, since programmers tended to only use a few hardware-dependent variable sizes, there wasn't a lot of conversion issues. Generally, I tended to add integers to integers, and add real numbers to real numbers. The complex rules type conversion rules were well enough thought out that they produced the right results when I did mixed-mode arithmetic. There are some issues with the implicit types of constants, but I never encountered any problems.

Slashdot Top Deals

...when fits of creativity run strong, more than one programmer or writer has been known to abandon the desktop for the more spacious floor. - Fred Brooks, Jr.

Working...