What should be added to C; K & R forever; call it PL/2

kjm at ut-ngp.UUCP kjm at ut-ngp.UUCP
Thu May 29 04:32:02 AEST 1986


[]

>>C already has a multi-level break statement.  It's spelled "goto."
>>Putting a goto in a costume doesn't disguise it.  [Andrew Koenig, I think]

>When a human reading a program sees 'break', it is immediately known
>that the current loop is being abandoned. In order to determine the
>effect of a goto, you have to find its destination. If you don't
>believe there is a big difference, try maintaining someone else's
>BAS*C code sometime.  [Greg Smith]

In order to determine the effect of a multi-level break, you have to
figure out which block it's terminating.  Maintaining code with lots
of multi-level breaks sounds like a programmer's nightmare, too.

Consider: you always know exactly what the goto is going to do.  But with
a multi-level break, it is possible to make a modification which changes
the number of interior blocks between one (or more) break(s) and its (their)
intended target(s).  This sounds like an excellent way to introduce very
subtle bugs.  Thus I think the explicit goto is cleaner in this situation.

>You're absolutely right. Let's all use K&R C only for the rest of time.
>[Greg Smith]

Given some of the suggestions made on this newsgroup by you, Mr. Smith, by
K. W. Heuer (i.e., indentation instead of braces), and by various others,
this might not be a bad idea at all!!


[From another article, about what to call "improved" C...]

>Sorry, I don't think you can call it PL/2!
>IBM was going to call PL/1 "NPL" (New Programming Language?) until
>National Physical Laboratories told them not to. They then registered
>names PL/1 ... PL/100 (!). I don't think they reserved PL/0.
>[Dean Elsner]

How about calling this new language "C--" ? (0.1 :-))

--
The above viewpoints are mine.  They are unrelated to
those of anyone else, including my cat and my employer.

Ken Montgomery  "Shredder-of-hapless-smurfs"
...!{ihnp4,allegra,seismo!ut-sally}!ut-ngp!kjm  [Usenet, when working]
kjm at ngp.{ARPA,UTEXAS.EDU}  [Old/New Internet; depends on nameserver operation]
kjm at ngp.CC.UTEXAS.EDU      [Very New Internet; may require nameserver operation]



More information about the Comp.lang.c mailing list