Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Jonas Maebe
On 17 Apr 2008, at 21:25, Andreas Berger wrote: for a := 0 to x do for b := 0 to y do for c := 0 to z do if (...) then begin // Do something and then exit all loops exit; // Or maybe: goto OutSideOfLoops; end; In Pascal I can't change the 'a' and 'b' values t

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread wi
C does have goto. cheers Wayne On Thu, Apr 17, 2008 at 12:57 PM, Marco Alvarado <[EMAIL PROTECTED]> wrote: > The problem of GOTO is that C doesn't have one. If C had one, and > Pascal didn't have a GOTO, they would blame Pascal for not having it. > In assembler GOTOs make a lot of sense (i.e. J

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Marco Alvarado
The problem of GOTO is that C doesn't have one. If C had one, and Pascal didn't have a GOTO, they would blame Pascal for not having it. In assembler GOTOs make a lot of sense (i.e. JMP and Jxx), and it's weird C doesn't have one, after all C tries to be the lowest level of the highest level languag

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Andreas Berger
I think "exit" and "goto" have their uses. Here is an example: for a := 0 to x do for b := 0 to y do for c := 0 to z do if (...) then begin // Do something and then exit all loops exit; // Or maybe: goto OutSideOfLoops; end; In Pascal I can't change the

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Alan Krause
Rodrigo Palhano wrote: this if ( payments per year <> 12 ) then begin Result := 1; exit; end; if ( rate = 0 ) then begin Result := 2; exit; end; is better than this ? if ( payments per year <> 12 ) then begin Result := 1 Else if ( rate = 0 ) then Result := 2; or even this ? In my

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Rodrigo Palhano
this if ( payments per year <> 12 ) then begin Result := 1; exit; end; if ( rate = 0 ) then begin Result := 2; exit; end; is better than this ? if ( payments per year <> 12 ) then begin Result := 1 Else if ( rate = 0 ) then Result := 2; or even this ? begin If not CheckPayments (Re

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Rodrigo Palhano
if X = 0 then Exit; at the beginning of the procedure, one writes if X <> 0 then begin When you use it at the begining it may be arguably ok. But when it is used in the middle of procedure code it may be hard to notice. On Thu, 17 Apr 2008 13:07:45 -0300, ik <[EMAIL PROTECTED]> wro

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Vinzent Hoefler
On Thursday 17 April 2008 17:53, mm wrote: > Rodrigo Palhano a écrit : > > On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> wrote: > >> I use GO TO when teaching pascal, but after all i ask them to not > >> use it, it > >> just a bridge to learning the logic of programming lang

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Alan Krause
mm wrote: Using "Exit" is not of a bad programming practice. Suppose one has to write a big procedure, say 150 lines of code. Suppose now that, instead of writing if X = 0 then Exit; at the beginning of the procedure, one writes if X <> 0 then begin ... Does a reader immediately see

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread ik
On Thu, Apr 17, 2008 at 6:53 PM, mm <[EMAIL PROTECTED]> wrote: > Rodrigo Palhano a écrit : > > > > On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> > wrote: > > > > > > > I use GO TO when teaching pascal, but after all i ask them to not use > it, it > > > just a bridge to learni

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread mm
Rodrigo Palhano a écrit : On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> wrote: I use GO TO when teaching pascal, but after all i ask them to not use it, it just a bridge to learning the logic of programming language. There is another word i hate to use it it is EXIT.

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Rodrigo Palhano
On Tue, 15 Apr 2008 19:39:37 -0300, Zaher Dirkey <[EMAIL PROTECTED]> wrote: I use GO TO when teaching pascal, but after all i ask them to not use it, it just a bridge to learning the logic of programming language. There is another word i hate to use it it is EXIT. I also understand EXIT as

[fpc-pascal] Re:Pascal Rant

2008-04-17 Thread Richard Ward
>>However it shows again the image problem of pascal, cause by people making assumptions on old compilers during their student years, and keep comparing it to later ones forever. >>If even reasonably intelligent people can't escape from it, maybe we are doomed. -- Maybe a new book need

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-17 Thread Zaher Dirkey
I use GO TO when teaching pascal, but after all i ask them to not use it, it just a bridge to learning the logic of programming language. There is another word i hate to use it it is EXIT. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http: