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

From: [at]} <Frans-Pieter>
Date: Tue, 28 Dec 2010 10:17:00 +0100

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

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----boundary-LibPST-iamunique-1558556786_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhlbGxvIExlcyxccGFyDQpccGFyDQp0aGFua3Mg
Zm9yIHlvdXIgY29udGVtcGxhdGlvbiBhYm91dCB0aGUgYmxpbmRuZXNzIGluIGZhaXRoIG9mIHRo
ZSBv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DQpccGFyDQotLS0tXHBhcg0KVG8gdW5zdWJzY3JpYmUs
IHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8gTElTVFNFUlZA
TElTVFMuT0JFUk9OLkNIXHBhcg0KfQ==
----boundary-LibPST-iamunique-1558556786_-_---
Received on Tue Dec 28 2010 - 10:17:00 UTC

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