RE: fixed windows

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 6 Aug 2003 at 12:10, Christian.CUVIER at agriculture.gouv.fr wrote:


> > And the way some people argue against an OPTION like goto in Eu is 
> > bordering on pathological.
> > 
> 
> 	I also learnt programming in Pascal,and I fully share Derek's view that 
> goto means higher maintenance time and cost. You really end up with a 
> mess of flags to tell if you are coming at this spot in code from a oto 
> or from linear flow, and that's why I skipped goto in VB programming 
> fast and happy.

Loops cause control to arrive at the end of the loop via any number of paths.
You end up by setting flags within the loop, so the following code can know
why the loop was exited.

> 	If speed is so critical that goto are needed, then these critical parts 
> of code are better written in C or ASM, so goto is pointless again.

goto has nothing to do with speed. Its sole purpose is to express
control flow  in a clearer way.  When misused, it has great potential to
obfuscate code, but when well used it can clarify the designers intentions.
Many other features also have obfuscation potential (indeed there are
programmers who can misuse ANY feature).
I would much rather work on code that had an occaisional goto than
on code that was mis-indented.

> 	But, since a multi-purpose language is used to write business-class 
> code as well as toy snippets by hobby programmers, why not include goto 
> in EU?
> 	A possible answer: implementing goto means a lot of cleaning and flow 
> control code. This is my experience from implementing them in idEu, and 
> it means extra code being executed. If the source doesn't have goto 
> inside, the preprocessor still must do some extra work in case there is 
> one downstream. So, you may have to (slightly) pay for it even if you 
> don't use it. I don't share some people's harsh attitude against this, 
> but can understand it.

That can be a real problem. Thats why.. 
See below.

> 
<snip>
> > 
> 
> Adding to my earlier statements about goto: what is sorely needed is 
> more flexible flow control, what I'd call structured or controlled goto. 
> For instance: exit one or more if blocks, exit one or more loops at a 
> time, possibly labelling them - this is a real bonus in maintenance-.
> Scoped variables and nested routines would really help too. Wait for 
> next year...
>
 
To quote from the Bach manual:

"Goto can only be used within a function or procedure, and it may
not jump out of that function or procedure. Jumping into a loop
is also prohibited"


> 
> Matt recently remarked that the Eu user base seems mostly interested by 
> GUI building and hardly anything else. Since this is not your main use 
> for EU (/me not mine either), you don't get listened too much on this list.
> <ad><h1>Join OE!</h1></ad>
> 
I have always felt that a big part of Eu's popularity was its
low-level ability -- run on dos, write console apps,
 poke memory, etc.
Maybe not.

Regards
Karl Bochert

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu