To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 21653
21652  |  21654
Subject: 
RE: Are there GOTO statements in NQC?
Newsgroups: 
lugnet.robotics
Date: 
Thu, 20 Nov 2003 23:20:02 GMT
Original-From: 
Rob Limbaugh <RLIMBAUGH@GREENFIELDGROUPavoidspam.COM>
Viewed: 
696 times
  
I find that GOTO is a very handy way to bypass code to test some
alternate code in high-level languages.  It is also a command that is
easy to match to a machine language code of various processor types.

In writing batch scripts on Windows platforms, GOTO becomes essential
because of the way certain commands are processed.

Of course, the last major programming I ever did was almost 20 years ago
when line numbers still had to be entered for programs in BASIC and the
equivalent for "GOTO" in ML was "JMP".  Back then, it some programs
would execute faster if simple commands were used.



-----Original Message-----
From: Steve Baker [mailto:sjbaker1@airmail.net]
Sent: Thursday, November 20, 2003 5:00 PM
To: Vadim Iosifovich Vaynerman
Cc: lego-robotics@crynwr.com
Subject: Re: Are there GOTO statements in NQC?

Vadim Iosifovich Vaynerman wrote:

I REALLY need to use a goto statement in the NQC programming project
I'm doing for the RCX. Dows anybody know if such a statement extsts,
and if so, what the syntax is? I know gotos are bad programming
practice, but its really hard to make a workaround here. All ideas are
appreciated.

Well, you'll hear people telling you:

1) Use the GOTO - it's fine.
2) Use it sparingly - it's dubious.
3) Use it only if you are totally stuck.
4) Never, ever use it - it is the work of Satan.

I fall into group (4).

I've been working as a professional programmer since the mid 1970's and
in all that time I've never even remotely felt the need to use a goto.

I've written fast, embedded software - where every cycle counts - I've
written large hard-to-maintain packages - and packages with lots of
logical complexity.
I'm currently writing software for military flight simulation - a fast,
complex and embedded application that contains almost half a million
lines of code (none of which are goto's.  Every US F16 pilot uses my
software to train with.

In all of those years, I've been in hundreds of these arguments with
programmers who think they know it all.  In all that time, I have yet to
see a piece of real world code (not some horribly contrived thing) that
couldn't be improved by restructuring it to remove the goto's.

If you need help in restructuring your code - post it here.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1@airmail.net>    WorkEmail: <sjbaker@link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
            http://tuxkart.sf.net http://prettypoly.sf.net -----BEGIN
GEEK CODE BLOCK----- GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++
N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++
y++++ -----END GEEK CODE BLOCK-----



Message has 1 Reply:
  Re: Are there GOTO statements in NQC?
 
Rob Limbaugh wrote: > I find that GOTO is a very handy way to bypass code to test some > alternate code in high-level languages. Nope - that's why we have #ifdef/#endif > It is also a command that is > easy to match to a machine language code of (...) (21 years ago, 20-Nov-03, to lugnet.robotics)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR