Subject:
|
Re: Are there GOTO statements in NQC?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 20 Nov 2003 22:00:20 GMT
|
Original-From:
|
Steve Baker <sjbaker1@airmail.!nospam!net>
|
Viewed:
|
891 times
|
| |
| |
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 is in Reply To:
| | Are there GOTO statements in NQC?
|
| Hello all, 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 (...) (21 years ago, 20-Nov-03, to lugnet.robotics)
|
19 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|