Subject:
|
Re: Are there GOTO statements in NQC?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 20 Nov 2003 18:43:41 GMT
|
Viewed:
|
973 times
|
| |
| |
In lugnet.robotics, Ralph Hempel wrote:
> In the hands of a practiced expert, the goto can be a thing of beauty
> and can make the code more readable, which is what we all want if we
> ever need to figure out the code.
In NQC, it is necessary to be especially careful about the use of goto as Dave
writes in the NQC Guide:
The goto statement should be used sparingly and cautiously. In almost every
case, control structures such as if, while, and switch make a program much more
readable and maintainable than using goto. Care should be taken to never use a
goto to jump into or out of a monitor or acquire statement. This is because
monitor and acquire have special code that normally gets executed upon entry and
exit, and a goto will bypass that code probably resulting in undesirable
behavior.
John Hansen
|
|
Message is in Reply To:
| | RE: Are there GOTO statements in NQC?
|
| (...) <snipped rant> (...) And as a longtime embedded guy myself, I agree with Mark. It's the old sharp tools and dull craftsman thing. In the hands of a practiced expert, the goto can be a thing of beauty and can make the code more readable, which (...) (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
|
|
|
|