Re: patch for 2.1.55 pre-1 minix/sysv/affs

Ricky Beam (root@defiant.interpath.net)
Sat, 13 Sep 1997 15:00:57 -0400 (EDT)


Letting the chips fall where they may, I quote Linus Torvalds:
>The thing that gave "goto" a bad name was irrational computer scientists,
>not any technical reason. The worst example of this is Pascal, also known
>as "The Truly Bad Programming Language Of All Time".

goto's are generally not accepted in CS classes because they want you think
logically and use the structuring of the language. Generally, there are
better ways to write your code than sticking goto's all over the place.
BUT, there are times when it just makes sense to use a goto. Error
conditions and other exceptions that would be insane to attempt to put
within some form of structure is a perfectly good reason for goto's.

>Actually, I suspect that what made goto's impopular among some computer
>scientists was not the code itself, but the bad compilers of the day. They
>just blamed it on "spagetti code". But take it from me: it's a damn lot
>easier to create bad code by overusing "good" features like exceptions and
>overloading than it is by using "goto".

I was weaned on FORTRAN... fortran has goto, but at NCSU, you could be
shot for using them -- and I did in some insane crappy program, I had
no choice [ok, I did, but 100+ lines of code or a goto?] The problem with
goto's has always been the compiler! If it isn't careful, all kinds of
memory leaks and stack errors fall out of the wood work. Fortran (Ultrix)
was very bad about not cleaning up at goto's, so jumping out of some nested
if/while/whatever would not cleanup the mess in the stack. Under Ultrix,
that would tend to crash the program and lose memory on the workstation.

--Ricky