John Coppens schrieb:
On Sat, 02 Dec 2006 08:01:04 -0500
David Mears <[EMAIL PROTECTED]> wrote:
From the first pascal program that I wrote in the late 80s to today,
I've only used Goto once and that was because I was still learning the
language - it was essentially a repeat loop and I replaced it in later
versions.
Same here...
But, I wonder. With modern optimizing compilers doing almost what they
want with the original source code, I'm quite sure some semantic
optimiser will replace parts of codes by goto's anyway. So why would it
ever be necessary to worry about optimising the source code with
'spaghetti' code, as we are shifting the responsability for optimising
execution to the compiler writers anyway?
If fact, if the optimiser is good, spaghetti (goto-)programs and 'nice'
code should generate the same executable anyway, shouldn't they? So,
doesn't it make sense to try and make the source as readable as possible?
gotos make life for optimizing steps based on data flow information very
hard, so using while, repeat etc. makes also life for an optimizer easier.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal