[comp.org.acm] Turbo the standard? I think not.

hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) (05/08/91)

In article <1494@caslon.cs.arizona.edu> shack@cs.arizona.edu (David Shackelford) writes:
>I have a decidedly PC-oriented viewpoint in this area.  Turbo IS the
>standard Pascal, IMHO.  Other Pascals need to change to the Turbo way
>of doing things. (With exception of machine-specifics).  When I
>program in "standard" Pascal I get completely lost because you can't
>do ANYTHING in it!

Turbo is NOT standard.  Since when is a ELSE on a CASE statement standard?
If one knows standard PASCAL, turbo is nothing.  BTW, the type STRING(n) 
is not standard either.  The standard way is PACKED ARRAY [1..x] OF string
where string = PACKED ARRAY [1..n] OF CHAR;  What is the reasoning behind
saying that Turbo is the standard?  Given it is used widely, but wide usage
does not make a standard.
--
Ack!                             esh101@psuvm.psu.edu             ESH101@PSUVM
hvozda@vivaldi.psu.edu           hvozda@endor.cs.psu.edu          DoD #0217

shack@cs.arizona.edu (David Shackelford) (05/08/91)

In article <?.bGejk$1@cs.psu.edu> hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) writes:
>
>Turbo is NOT standard.  Since when is a ELSE on a CASE statement standard?
>If one knows standard PASCAL, turbo is nothing.  BTW, the type STRING(n) 
>is not standard either.  The standard way is PACKED ARRAY [1..x] OF string
>where string = PACKED ARRAY [1..n] OF CHAR;  What is the reasoning behind
>saying that Turbo is the standard?  Given it is used widely, but wide usage
>does not make a standard.

I didn't mean to say Turbo is standard, merely that it should be.

Else on a case statement -- case is useless to me without it.  I
assume that the standard doesn't have anything like C's "default".

String in the Turbo syntax is much simpler to use and easier to
read.  What's a "packed array"?  Why go to the bother of defining
your own string if the implementation gives you one?  Can you
concatenate standard pascal "Strings"?  How 'bout deleting from
the middle of a string, inserting into the middle, and searching
for a substring?  I honestly don't know, because I gave up and
moved to a different language for Unix long ago.

I didn't learn Turbo Pascal from a college class, I learned it
on my PC at home.  Every time I try to write a standard Pascal 
program on Unix I find something that Turbo does but standard
doesn't.  I haven't tried much standard Pascal because it's
too frustrating -- I do it in C instead. 

Dave  |   Turbo user since 1.0

frist@ccu.umanitoba.ca (05/08/91)

In article <1497@caslon.cs.arizona.edu> shack@cs.arizona.edu (David Shackelford) writes:
>In article <?.bGejk$1@cs.psu.edu> hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) writes:
>>
>>Turbo is NOT standard.  Since when is a ELSE on a CASE statement standard?
>>If one knows standard PASCAL, turbo is nothing.  BTW, the type STRING(n) 
>>is not standard either.  The standard way is PACKED ARRAY [1..x] OF string
>>where string = PACKED ARRAY [1..n] OF CHAR;  What is the reasoning behind
>>saying that Turbo is the standard?  Given it is used widely, but wide usage
>>does not make a standard.
>
>I didn't mean to say Turbo is standard, merely that it should be.
>
... examples of non-standard Turbo constructs

>I didn't learn Turbo Pascal from a college class, I learned it
>on my PC at home.  Every time I try to write a standard Pascal 
>program on Unix I find something that Turbo does but standard
>doesn't.  I haven't tried much standard Pascal because it's
>too frustrating -- I do it in C instead. 
>
>Dave  |   Turbo user since 1.0

The frustration runs both ways. Turbo Pascal eliminated the ability to 
access the file pointer. For example:

if F^ = CH then   {CH is a char, F is a text file}

This is a fundamental part of file I/O in canonical J&V STANDARD Pascal,
and is handy because it lets you pre-screen the next character before it is
read in. I have used this in dozens of programs over more than a decade,
with 8 different Pascal compilers, and TP is the first that had the
audacity to eliminate such a fundamental STANDARD feature. I gave my 
copy of TP away and bought Microsoft.
 
===============================================================================
Brian Fristensky                |  
Department of Plant Science     | "There's a big ... machine in the sky...
University of Manitoba          | some kind of electric snake... coming
Winnipeg, MB R3T 2N2  CANADA    | straight at us." 
frist@ccu.umanitoba.ca          | "Shoot it," said my attorney.
Office phone:   204-474-6085    |"Not yet," I said,"I want to study its habits"
FAX:            204-275-5128    |H.S. Thompson, FEAR & LOATHING IN LAS VEGAS
===============================================================================

hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) (05/08/91)

Well I always had to use:

IF condition_not_in_the_case THEN
   do_what_the_else_would_have
ELSE
   case_here

>String in the Turbo syntax is much simpler to use and easier to
>read.  What's a "packed array"?  Why go to the bother of defining

PACKED ARRAY is to tell the complier to nake the best use of the machines
memory.  It certian cases like that of an array of BOOLEAN, it would normally
put one bit per word of storage, but with PACKED, it tells it to use
all the bits in each word.  However, a trade off of a greater execution time
may result.

>your own string if the implementation gives you one?  Can you
>concatenate standard pascal "Strings"?  How 'bout deleting from
>the middle of a string, inserting into the middle, and searching
>for a substring?  I honestly don't know, because I gave up and
>moved to a different language for Unix long ago.

You end up writing all the funtions yourself.  :(  I hate it.  Infact
I once had to write a string function package for a class.  It was
NOT fun.  There are many things I wish Standard had, but it doesn't.
TURBO has these things, but most machines I work on does not have TURBO.
I guess it all depends upon your situtation.

>I didn't learn Turbo Pascal from a college class, I learned it
>on my PC at home.  Every time I try to write a standard Pascal 
>program on Unix I find something that Turbo does but standard
>doesn't.  I haven't tried much standard Pascal because it's
>too frustrating -- I do it in C instead. 

I am trying C now myself.  There are time when I find it just as frustrating
as you find TURBO <-> STANDARD PASCAL.  If we keep at it, we will get it :)
--
Ack!                             esh101@psuvm.psu.edu             ESH101@PSUVM
hvozda@vivaldi.psu.edu           hvozda@endor.cs.psu.edu          DoD #0217

gvreugdenhil@watmsg.waterloo.edu (Gord Vreugdenhil) (05/09/91)

In article <a$2Gg.5#1@cs.psu.edu> hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) writes:
>Well I always had to use:
>
>IF condition_not_in_the_case THEN
>   do_what_the_else_would_have
>ELSE
>   case_here
>
>>String in the Turbo syntax is much simpler to use and easier to
>>read.  What's a "packed array"?  Why go to the bother of defining
>
>PACKED ARRAY is to tell the complier to nake the best use of the machines
>memory.  It certian cases like that of an array of BOOLEAN, it would normally
>put one bit per word of storage, but with PACKED, it tells it to use
>all the bits in each word.  However, a trade off of a greater execution time
>may result.
>

Hmm.  I don't have my copy of the Pascal standard handy, but I am pretty sure
that the compiler is allowed to interpret ``PACKED'' in any way it wants --
i.e. it *may* choose a more efficient storage method, it may not do anything.
Pascal doesn't define storage of any structures; any array may be 
"packed" by default and have ``PACKED'' be a nop, or never "pack" elements, 
etc.  In an undergrad/grad class we wrote (most of) an ISO Pascal compiler;
it stored arrays of chars in a packed format independent of the ``PACKED''
keyword.  All other types were the opposite (always unpacked -- including
boolean... bleck) due to time constraints. 

[...stuff deleted...]

>Ack!                             esh101@psuvm.psu.edu             ESH101@PSUVM
>hvozda@vivaldi.psu.edu           hvozda@endor.cs.psu.edu          DoD #0217

Gord Vreugdenhil
gvreugdenhil@watmsg.waterloo.edu

ts@uwasa.fi (Timo Salmi) (05/09/91)

In article <1497@caslon.cs.arizona.edu> shack@cs.arizona.edu (David Shackelford) writes:
>In article <?.bGejk$1@cs.psu.edu> hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) writes:
>>
>>Turbo is NOT standard.  Since when is a ELSE on a CASE statement standard?
>>If one knows standard PASCAL, turbo is nothing.  BTW, the type STRING(n) 
:

But which is more essential.  What the market decides (that is what
the users buy and use), or what some committee expounds that we
should want and use.  Standards are good when they bring sensible
harmonization, standards are bad when they stand in the way of
useful delopments.  I plead my CASE if you'll pardon the pun. 

...................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

peter@ficc.ferranti.com (Peter da Silva) (05/09/91)

In article <1991May8.135504.310@ccu.umanitoba.ca> frist@ccu.umanitoba.ca writes:
> The frustration runs both ways. Turbo Pascal eliminated the ability to 
> access the file pointer. For example:

> if F^ = CH then   {CH is a char, F is a text file}

Yes, this sort of gratuitous breakage is what turned me right off on Turbo.
If you wanted Pascal for a PC, why not UCSD? Not only does it properly support
standard Pascal, it added such vital capabilities as modules. Plus if you
had a random-access file you could do stuff like:

	var f: file of record ... end;

	begin
		if f[10]^.elt = thing then ... { might be "f^[10].", been a
						 while }
-- 
Peter da Silva; Ferranti International Controls Corporation; +1 713 274 5180;
Sugar Land, TX  77487-5012;         `-_-' "Have you hugged your wolf, today?"

kim@cs.uwa.oz.au (Kim Shearer) (05/10/91)

hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) writes:

>In article <1494@caslon.cs.arizona.edu> shack@cs.arizona.edu (David Shackelford) writes:
>>I have a decidedly PC-oriented viewpoint in this area.  Turbo IS the
>>standard Pascal, IMHO.  Other Pascals need to change to the Turbo way
>>of doing things. (With exception of machine-specifics).  When I
>>program in "standard" Pascal I get completely lost because you can't
>>do ANYTHING in it!

>Turbo is NOT standard.  Since when is a ELSE on a CASE statement standard?
>If one knows standard PASCAL, turbo is nothing.  BTW, the type STRING(n) 
>is not standard either.  The standard way is PACKED ARRAY [1..x] OF string
>where string = PACKED ARRAY [1..n] OF CHAR;  What is the reasoning behind
>saying that Turbo is the standard?  Given it is used widely, but wide usage
>does not make a standard.
>--
>Ack!                             esh101@psuvm.psu.edu             ESH101@PSUVM
>hvozda@vivaldi.psu.edu           hvozda@endor.cs.psu.edu          DoD #0217

  I am afraid that there is a standard for Pascal. The world will not
  change just because you like Turbo. Other Pascals do not _need_ to
  change at all, especially to a Turbo/Borland fast and dirty 
  approach.

+--------------------------------+--------------------------------------------+
Kim Shearer                      |     ACSnet: kim@cs.uwa.oz.au
Dept. of Computer Science        |     PHONE:  +61 9 380 3453 
University of Western Australia  |     
CRAWLEY, Australia 6009          |     
+--------------------------------+--------------------------------------------+

jfr@locus.com (Jon Rosen) (05/11/91)

In article <kim.673865699@kowari> kim@cs.uwa.oz.au (Kim Shearer) writes:
>hvozda@mirkwood.endor.cs.psu.edu (Eric S Hvozda) writes:
>>shack@cs.arizona.edu (David Shackelford) writes:
>>>I have a decidedly PC-oriented viewpoint in this area.  Turbo IS the
>>>standard Pascal, IMHO.  Other Pascals need to change to the Turbo way
>>>of doing things. (With exception of machine-specifics).  When I
>>>program in "standard" Pascal I get completely lost because you can't
>>>do ANYTHING in it!
>>Turbo is NOT standard.  Since when is a ELSE on a CASE statement standard?
>>If one knows standard PASCAL, turbo is nothing.  BTW, the type STRING(n) 
>>is not standard either.  The standard way is PACKED ARRAY [1..x] OF string
>>where string = PACKED ARRAY [1..n] OF CHAR;  What is the reasoning behind
>>saying that Turbo is the standard?  Given it is used widely, but wide usage
>>does not make a standard.
>I am afraid that there is a standard for Pascal. The world will not
>change just because you like Turbo. Other Pascals do not _need_ to
>change at all, especially to a Turbo/Borland fast and dirty 
>approach.

I read this group but usually don't comment.
 
However, this got my blood boiling...
 
Of course there is a standard.  So what?  Standards are created in order
to guide and structure the future in a compatible manner.  However, when
that does not come to pass, the standard dies an ignominious death.
 
Which is exactly what I predict for the Pascal standard in the long run.
True, Turbo Pascal does some things wrong, not only in the eye of the
standard but in the eyes of reasonable observers.  However, it does a
lot of things right.  It is pointed out that there is no ELSE on a CASE
statement in the standard.  Right... But why is that? Is that good?
Of course not, it is clearly a blunder in the standard.  The lack of
support for strings in Pascal is clearly a blunder.  ANSI did not have
to design a usable, sellable language, they never do.  All they had
to do was satisfy the myriad groups who were on the standards committee.
Borland, while not making a perfect product, went out of their way to
incorporate GOOD feature additions to their language.  What's more,
the proof is in the putting.  People USE Turbo Pascal, far more than
they use any other of several dozen "standard" Pascals.  It is fast.
It is reasonably complete.  It is useful for building good programs.
It has some ommissions, no doubt, but it has so much more, that it
exceeds.  And more importantly, the marketplace has voted with its
dollars.  You may say Turbo is not the standard, but, like it or not,
it most certainly is.  
 
By the way, objects are not in the Pascal standard either, but I doubt
anyone who has switched to TP5.5 or TP6 or TPW would want to go back
to the old way of programming.  
 
PS.. The American car companies took this view a long time ago.  They
made fins on cars as "standards"... They made gas guzzlers as "standards".
And the Japanese tossed out the standards and the American car 
companies are going broke today.  Sorry folks, but if you hide behind
a fantasy (like the Pascal "standard") you get what you deserve.
 
PPS.. Since when is anything wrong with "fast and dirty"?  Most great
programs were written that way.  More importantly, I challenge that
comment, particularly in light of TP5.5/6/W with Objects.  Turbo Pascal
is a future looking language, whereas Pascal is a moribund language
going nowhere.  Even Wirth admits that (hence his support for Modula).
By the way, Wirth is appearing with Kahn in a video that Borland is
now advertising in their new magazine.  I wonder what he thinks of
Turbo Pascal?
 
Jon Rosen

Jeff Boyd <BOYDJ@QUCDN.QueensU.CA> (05/11/91)

String support is not exactly a wonderful improvement to Pascal. It may
make some programming easier (and it has at times for me), but using an
'[packed] array of char' is a better discipline. TP does *NOT* treat
strings in a disciplined manner when they are passed to procedures.