Re: [BLACKBOX] Re [BLACKBOX] Seasons Greetings from Linuxland

From: Rene A. Krywult <"Rene>
Date: Tue, 28 Dec 2010 11:32:37 +0100

----boundary-LibPST-iamunique-822833934_-_-
Content-type: text/plain

>From this code, I get the feeling that the guy programming in Pascal was stacking the deck against Pascal.

The following would be fully sufficient:

{$N+}
program acm;
  var a, b, c : integer;
begin
   while not eof do
   begin
     readln(a, b);
     if b > a then
         c:=b-a
     else
         c:=a-b
     writeln(c);
   end
end

Rene

-------- Original-Nachricht --------
> Datum: Tue, 28 Dec 2010 10:17:00 +0100
> Von: Frans-Pieter Vonck <Frans-PieterVonck{([at]})nowhere.xy
> An: BLACKBOX{([at]})nowhere.xy
> Betreff: Re: [BLACKBOX] Re [BLACKBOX] Seasons Greetings from Linuxland

> Hello Les,
>
> thanks for your contemplation about the blindness in faith of the oberon
> users.
> I followed your reference to the statistics site.
> What I've understood is that the table is the result of a "Solution Judge"
> - robot of the the course. Probably they have compared the errors made by
> students over the years, using different programming languages.
> The students have to submit 100 program exercises that are evaluated
> automatically. I
>
> One of the lecturer's example programmes can be found here
> http://www.cs.sunysb.edu/~skiena/392/programs/
> Below I quote two versions of an standard io programme given by Skiena ,
> one in C the other in Pacal
>
> #include<stdio.h>
>
> int main() {
> long p,q,r;
>
> while (scanf("%ld %ld",&p,&q)
> !=EOF) {
> if (q>p) r=q-p;
> else r=p-q;
>
> printf("%ld\n",r);
> }
> }
>
>
> {$N+}
> program acm;
> var
> a, b, c : integer;
> begin
> while not eof do
> begin
> readln(a, b);
> if b > a then
> begin
> c := b;
> b := a;
> a := c
> end;
> writeln(a - b);
> end
> end.
>
> From this code I understand why Wirth was surprised that everyone kept

> programming in Pascal.
>
>
> During the Christmas holidays I do some recreational programming in
> Oberon. I'm solving some of the excercices of Nikitin's Into the Realm of
> Oberon for fun. Programming in C-derivatives would certainly spoil my
> holiday rest.
>
> Greets,
> F.P.Vonck
>
> > "The ugliness of a construct usually appears in combination with other

> language features. In C, we may write, for example, x+++++y, a riddle
> rather
> > than an expression, and a challenge for a sophisticated parser!
> >
> > Wirth's line x+++++y won't compile with the only C compiler I have

> available at the moment.
> >
> > When
> > z = 0;
> > x = 1;
> > y = 1;
> >
> > The expressions
> >
> > z = x++ + y++;
> > z = x++ + ++y; Wirth's example
> > z = ++x + y++;
> > z = ++x + ++y;
> >
> > yield values of 2, 3, 3, 4 respectively.
> >
> > As Chris Burrow' said, "C just gives you so many different wonderful

> ways to shoot yourself in the foot". C programmers are not obliged to
> write code like this. They are free to spread the code over several
> lines. They choose not to do so preferring to rely on 'C idioms'.
> >
> > The problem is that in order to understand what the programmer intended

> the result of this expression should be, the reader has to evaluate the
> expression according to the precedence rules for operators in C. All
> this to save two Linefeeds, two characters and two semicolons.
> >
> > Pascal/Modula/Oberon programmers are not entirely free of this approach.
> >
> > The code
> >

> > PROCEDURE IsDigit(ch: CHAR): BOOLEAN;
> > BEGIN
> > RETURN (ch <= '9') & (ch >= '0')
> > END IsDigit;
> >
> > is regarded as good 'style'.
> >
> > Yet it suffers from the same problem as the C code above. To understand

> what the programmer intended the reader has to evaluate what follows the
> RETURN.
> >
> > The code
> >
> > PROCEDURE IsDigit(ch: CHAR): BOOLEAN;
> > VAR
> > b: BOOLEAN;
> > BEGIN
> > b := FALSE;
> > IF (ch >= '0') & (ch <='9') THEN
> > b := TRUE;
> > END;
> > RETURN b;
> > END IsDigit;
> >
> > is regarded as bad 'style', but the intention of the programmer is
> > more easily understood.
> >
> > It is an article of faith for 'Oberoners' that Wirthian languages are
> superior to 'C' type languages and that their use makes it easier to
> write bug free code.
> >
> > Look at
http://acm.uva.es/problemset/statsjudge2.php for some empirical
> evidence%
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt auch mit 
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-822833934_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEZyb20gdGhpcyBjb2RlLCBJIGdldCB0aGUgZmVl
bGluZyB0aGF0IHRoZSBndXkgcHJvZ3JhbW1pbmcgaW4gUGFzY2FsIHdhcyBzdGFja2luZyB0aGUg
ZGVjayBhZ2FpbnN0IFBhc2NhbC5ccGFyDQpccGFyDQpUaGUgZm9sbG93aW5nIHdvdWxkIGJlIGZ1
bGx5IHN1ZmZpY2llbnQ6XHBhcg0KXHBhcg0KXHskTitcfVxwYXINCnByb2dyYW0gYWNtO1xwYXIN
CiAgdmFyIGEsIGIsIGMgOiBpbnRlZ2VyO1xwYXINCmJlZ2luXHBhcg0KICAgd2hpbGUgbm90IGVv
ZiBkb1xwYXINCiAgIGJlZ2luXHBhcg0KICAgICByZWFkbG4oYSwgYik7XHBhcg0KICAgICBpZiBi
ID4gYSB0aGVuXHBhcg0KICAgICAgICAgYzo9Yi1hXHBhcg0KICAgICBlbHNlXHBhcg0KICAgICAg
ICAgYzo9YS1iXHBhcg0KICAgICB3cml0ZWxuKGMpO1xwYXINCiAgIGVuZFxwYXINCmVuZFxwYXIN
ClxwYXINClJlbmVccGFyDQpccGFyDQotLS0tLS0tLSBPcm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IGFiIDE5LDk5IEV1cm8vbXRsLiEgSmV0enQgYXVjaCBt
aXQgXHBhcg0KZ3JhdGlzIE5vdGVib29rLUZsYXQhIGh0dHA6Ly9wb3J0YWwuZ214Lm5ldC9kZS9n
by9kc2xccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUsIHNlbmQgYSBt
ZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZATElTVFMuT319
AKJ0p1AhIEq5gHpnEQ==
----boundary-LibPST-iamunique-822833934_-_---
Received on Tue Dec 28 2010 - 11:32:37 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:26 UTC