Apologies - I did not mean to imply anything "bad" or "evil" in my quote of the 
prof (who was a structured programming nut), but I probably sounded that way.

I actually agree that GOTO should be available for all the situations in which 
it is appropriate.  However, I also know how it can be easily misused - 
resulting in buggy code, or spaghetti code or unmaintainable code or whatever.

I liken it's inclusion or exclusion in a "language" to e.g. a choice between C 
and Pascal.  Pascal has been referred to as a "perfect high-level language" - 
but it is also a perfect pain!  Once you are used to programming with pointers 
in C, you find Pascal soooooo limiting.  How you wish you had a pointer 
available to simplify and speed up this specific algorithm you are working on.  
So you return to C, and then one day, you leave your pointers pointing to outer 
space, and the program crashes with a variable which has mysteriously and 
autonomously changed its value - and until you have identified the bug - you 
spend your time getting upset with the compiler that is not doing what you are 
telling it to do!

So the "higher-level" your language is, the more you are protected from your 
own silliness.  The "lower-level" your language is, the more empowered you are 
to do fast and fancy things - but with a stability cost.  (Believe it or not,  
I prefer C or even Assembler in some instances!)

The question we are really debating is, is the LinuxCNC G-dialect a high level 
or low level language, or even an Assembler?  And I believe that each one of us 
on the list has a different view as to how high or how low we should go!  My 
personal view is that it does need the power of the availability of a GOTO/JMP, 
but that it should be couched in caution and/or protection for the beginner.

Ideally, it should be available when an "advanced" switch has been triggered, 
but be turned off by default.  However, I say this with trepidation, as many of 
us know that even this approach is fraught with pitfalls :-).  How many of us 
have at times forgotten to include the gcc -std=gnu99 switch?

Well - enough philosophising - thanks again to all the guys who have made 
linuxCNC the powerful package it is.


Dr Cecil L Churms
Principal Scientist 
DebTech
De Beers Group Services (Pty) Ltd

[email protected] | Tel: +27 11 309 3832  | Fax: +27 11 309 3052


 

-----Original Message-----
From: alex chiosso [mailto:[email protected]] 
Sent: 03 October 2014 09:35 AM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] Uncondiftional , Conditional Program Jumps .

Honestly I don't understand what "evil" is inside the GOTO statement to be 
rejected .
As I told before so many CNC manufactures are including it in their G Code 
dialects .
So are they living on another planet ?
A programmer can write bad code without any use of GOTO.
So why the absence of GOTO is saving a programmed from write bad code ?
I'm deeply convinced (by the practical usage) that with GOTO is possible to 
write programs much more clear and structured than without.

Regards

Alex

On Fri, Oct 3, 2014 at 9:12 AM, Churms, Cecil <[email protected]
> wrote:

> I am reminded of a sign on one of the computer science professor's 
> door at the university where I worked:
>
> "GOTO is an obscene four-letter word and should only be used in dire 
> emergencies - but even then, not in good company"
>
> ...or something to that effect.
>
> That kind-of sums it up :-)
>
> Regards
>
> Cecil
>
> -----Original Message-----
> From: Marcus Bowman [mailto:[email protected]]
> Sent: 02 October 2014 11:59 PM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Uncondiftional , Conditional Program Jumps .
>
>
> On 2 Oct 2014, at 18:32, andy pugh wrote:
>
> > On 2 October 2014 17:59, alex chiosso <[email protected]> wrote:
> >
> >> I've checked out the "jump" functionality (within the G code) used 
> >> from several CNCs on the market (Fanuc,Siemens ,Heidenhain,Fagor 
> >> ...) and it is present.
> >
> > Nearly every other programming language either does not have a 
> > jump/goto or deprecates the use of it.
> >
>
> I second that emotion
>
> .....
>
>
> **********************************************************************
> ******* The information contained in this e-mail is confidential and 
> may be subject to legal privilege. If you are not the intended 
> recipient, you must not use, copy, distribute or disclose the e-mail 
> or any part of its contents or take any action in reliance on it. If 
> you have received this e-mail in error, please e-mail the sender by 
> replying to this message. All reasonable precautions have been taken 
> to ensure no viruses are present in this e-mail and the sender cannot 
> accept responsibility for loss or damage arising from the use of this 
> e-mail or attachments.
>
> .*********************************************************************
> ********
>
>
> ----------------------------------------------------------------------
> -------- Meet PCI DSS 3.0 Compliance Requirements with EventLog 
> Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI 
> DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download 
> White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with 
> EventLog Analyzer
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.
> clktrk _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 
3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready 
for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 
Requirement 10 and 11.5 with EventLog Analyzer 
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

*****************************************************************************
The information contained in this e-mail is confidential and may be subject to 
legal privilege. If you are not the intended recipient, you must not use, copy, 
distribute or disclose the e-mail or any part of its contents or take any 
action in reliance on it. If you have received this e-mail in error, please 
e-mail the sender by replying to this message. All reasonable precautions have 
been taken to ensure no viruses are present in this e-mail and the sender 
cannot accept responsibility for loss or damage arising from the use of this 
e-mail or attachments.
.*****************************************************************************

*****************************************************************************
The information contained in this e-mail is confidential and may 
be subject to legal privilege. If you are not the intended recipient, 
you must not use, copy, distribute or disclose the e-mail or any 
part of its contents or take any action in reliance on it. If you have 
received this e-mail in error, please e-mail the sender by replying 
to this message. All reasonable precautions have been taken to 
ensure no viruses are present in this e-mail and the sender cannot 
accept responsibility for loss or damage arising from the use of this 
e-mail or attachments.
.*****************************************************************************

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to