Subject: RE: [hackers-il] [[email-masked]: Shimon Schocken on Tu esday 05/06/2001]

From: Chen Shapira <[email-masked]>
Date: Tue, 10 Apr 2001 11:44:20 +0200

> I don't know the official rules, but my inner morals tells me 
> that it is
> perfectly fine to publish homework *you* did, assuming that 
> your solution
> is a much more substantial work than the question itself. 
> What is NOT fine
> is to look at such solutions instead of trying to do the work 
> yourself.

IMO if the homework grade isn't part of the final grade, there's nothing
immoral with copying work, its just abit stupid.

> In my opinion the same should be true also for tests: you 
> should be allowed
> to publish previous tests and suggested solutions. As far as 
> I saw, this was
> the norm in the Technion (the student union even gave people 
> small gifts
> if you gave them copies of tests) but strangely it seems to 
> be frowned upon
> in HaifaU...

Same in TAU. But most of us learned that those solutions aren't too
reliable.

> It is obvious why professors would not want previous 
> excercises and tests
> to be published - it will force them to make up new questions 
> every once
> in a while. But every now and then these professors need to 
> be reminded that
> they are paid for this work, and that the raison d'etre of BA 
> studies is
> to teach the students well, not to make life easy for the professor...

Over here most assistants publish previous tests and excersizes in their web
page.
But I suspect that those assistants enjoy making the professors work.

> > a rant on pascal: how can a language have none of
> > case sensitivity
> > initialization of const arrays
> > no return from functions or procedures (!)

I didn't do pascal for a long time, but:

1) I don't think there is any inherit advantage to case sensitivity over
case insensitivity in programming languages. Its more of a matter of taste
and common practices.
What is very important is the proper use of case in variable names, but this
has nothing to do with the language.

2) What do you mean by "no return from functions"? IIRC you call a function
and get a returned value, no?

The worse part about Pascal IMO is that there's no pointer to functions, and
no annonymous functions. On the other hand it has nested functions (I
think), which I wouldn't mind seeing in more langauges.

---

From: mulix <[email-masked]>
Date: Tue, 10 Apr 2001 14:12:53 +0300 (IDT)

> has nothing to do with the language.

sure there is, when you are debugging with a textual debugger, such as
gdb. why, oh why, if i declare a variable as foo_bar, should i do 'print
FOO_BAR'? i suspect at some point the debugging symbols are converted to
upper case by the compiler.

> and get a returned value, no?

of course, of course. i was referring to a return in the middle of a
function, once you discover an error condition or a predicate cannot be
fulfilled. also, since the code i wrote used a back tracking (recursive)
algorithm, being able to return in the middle of a function was crucial. 

> think), which I wouldn't mind seeing in more langauges.

pointers to functions you don't have, but i seem to recall you can pass
the functions themselves as parameters, just cannot return them?

-- 
mulix
http://www.advogato.com/person/mulix

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

---

From: "Nadav Har'El" <[email-masked]>
Date: Tue, 10 Apr 2001 14:55:47 +0300

> algorithm, being able to return in the middle of a function was crucial. 

Several people repeated this "fact", that Pascal doesn't have a statement
to return in the middle of the function. Are you sure??? I haven't programmed
Pascal for quite a few years, but I seem to remember it had a "return"
statement. In fact, I remember arguing with the Metargel in the course
"Mavo Lemachshev Pascal" who deducted points for using "return" - eventually
I got him to admit (if I remember correctly) that there is such a statement
but it is considered "muktze michamat mius", like C's "goto".

Perhaps the Wirth's original Pascal didn't have a return statement, and
only later extensions added it? I don't know...

-- 
Nadav Har'El                        |      Tuesday, Apr 10 2001, 17 Nisan 5761
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |I couldn't think of an insteresting
http://nadav.harel.org.il           |signature to put here... Maybe next time.

---

From: mulix <[email-masked]>
Date: Tue, 10 Apr 2001 15:12:35 +0300 (IDT)

> to return in the middle of the function. Are you sure??? I haven't programmed

empirically sure. when writing the excersize, we searched in all of the
pascal books we found, and none of them made any mention of this. perhaphs
it is a frowned upon idiom?

> but it is considered "muktze michamat mius", like C's "goto".

c's goto is a painful subject for me. i happen to think that using c's
goto in controlled circumstances, like omer described in another post and
can be seen copiously in kernel sources, is a pretty neat technique.
unfortunately, i have refrained from using it in all technion assignments,
to spare myself from arguing with TAs. of course this only means i get
deducted points for other unorthodox coding methods which the TAs are not
familiar with, but i've never shied away from a good argument :)

case in point, in one excersize in matam i used a) extern to support a
single global log object in a c project and b) implemented myself a matrix
object we were given an object file for (which i considered buggy). this
lead to the ta's automatic compilation tests breaking on my code in new
and spectacular ways. i got 50 on the exercise, and after 30 minutes of
explaining to the teacher's assistants why what i did was both legal and a
good idea, got my grade boosted to 110 (there was a trivial bonus).

> only later extensions added it? I don't know...

i'm curious if anyone is using pascal in the "real world". i do know of
a few places using "object pascal" (borland's delphi).  
-- 
mulix
http://www.advogato.com/person/mulix

---

From: "Nadav Har'El" <[email-masked]>
Date: Tue, 10 Apr 2001 17:37:02 +0300

> it is a frowned upon idiom?

Hmmm... I looked again at an old Pascal program I had, and it was an "exit"
statement that returned from a function (not called "return" as I thought).
And some website digging I found the following in the Gnu Pascal manual
http://didaktik.physik.uni-essen.de/~gnu-pascal/gpc_286.html#SEC286

    "'Exit' leaves the currently executed procedure or function.
     `Exit' is a UCSD Pascal extension. GNU Pascal does not support all
     uses of `Exit' but only those defined in Borland Pascal."

So I guess "exit" appeared in UCSD Pascal, and then copied to Borland's
"Turbo Pascal" (at least from version 4, which was the first version I
used). I bet it exists in any modern Pascal implementation...
Actually, UCSD pascal dates back to 1978, which predates the ISO standard
(1983) or Borland's Turbo Pascal, or even Kernighan's paper. I don't see
how the metargelim, or even Kernighan can claim that Pascal doesn't have
an "exit" statement - Wirth's original Pascal from 1970 is just as irrelevant
as the Fortran original 1956 standard... I haven't read the 1983 standard
though - perhaps they decided not to except the "exit" extension, even
though all implementations had it?

BTW, Turbo Pascal also had (if I remember correctly) a "break" statement
to exit loops that Kernighan writes that Pascal doesn't have... I guess that
modern pascal compilers fixed some of the things that bothered him :)

-- 
Nadav Har'El                        |      Tuesday, Apr 10 2001, 17 Nisan 5761
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |How long a minute depends on what side
http://nadav.harel.org.il           |of the bathroom door you're on.