Subject:
|
Re: My RCX is HAUNTED
|
Newsgroups:
|
lugnet.org.ca.rtltoronto
|
Date:
|
Fri, 12 Sep 2003 14:57:21 GMT
|
Viewed:
|
510 times
|
| |
| |
In lugnet.org.ca.rtltoronto, Calum Tsang wrote:
> In lugnet.org.ca.rtltoronto, Chris Magno wrote:
> > > I'm the worst programmer I know, and even I know how not to use 64 IF's. :)
>
> > I don't need to point out who won that event, and who did not even have a robot.
>
> Well, let's see. Rob won the event...and I know he can program--or at least his
> dad can.
>
> Who didn't have a robot? Well, I brought one with Mario. Hrm. We can both
> program (He wrote the majority of the code, I wrote a small part on a secondary
> RCX)...
>
> Who else is in this conversation....Bruce....Within five minutes of the ProjectX
> challenge being spawned in 2001, while you were still wondering how to fit 16
> cells of data into limited RCX variables (Chris answer: Avoid variables, just
> use IF-THENs!) Bruce was already grinning and mumbling the word "bitmask" to
> himself...so Bruce is okay...
>
> ...so...what were you trying to point out again? :)
Man, you guys sure fight well.....
As a person whos programmed at every level of the machine, microcode, machine
code, assembly code, high level code, I can tell you that in tight coding
environments, keeping the variables to a minimum sure makes the code easier to
understand and debug.
The *most* important piece of state in *any* running program is the program
counter. I had to read this one guy's code (it was supposed to be very fast and
reliable) and had a really tough time because he had too many state variables
hanging around.
He had about 40 variables across 40 variables. He couldn't add the error
handling required by the IBM Inter-System Channel (think Mainframes.) He
couldn't keep track of how to do it because of all the variables. He went off
for a two week vacation, and I rewote and debugged the code that had taken him a
year to write and debug, *and* I added the required error handling while still
achieving the required performance.
I did this by getting rid of all but 2 of his variables, and adding more code.
The other 38 variables were merely there to tell him where he was in the code,
rather than using the program counter to tell him where he was. More code is
sometimes the *best* answer. I've been programming since I was 14, which means
I've been coding for 30 years. This is probably why I try to make my projects
work *without* using the RCX. Using the RCX on every project would make things
too easy and it too much like work.
Given that the RCX has so few variables, I've been known to use more code to
save variables. It is a very clever strategy IMHO, and I applaud Chris for
thinking of it.
Kevin (would love to be a member of RTL Toronto) Clague
|
|
Message has 4 Replies: | | Re: My RCX is HAUNTED
|
| (...) With an attitude like that, there is NO WAY you could ever join our group. The number 1 requirement is that you mock Chris mercilessly! Dont you realize that Chris will be quoting this post for years to come...He has probably already got it (...) (21 years ago, 12-Sep-03, to lugnet.org.ca.rtltoronto)
| | | Re: My RCX is HAUNTED
|
| (...) thanks. but what people don't see is that off line we are all good friends. that's why we have monthly dinners. so although it looks like we are "fighting" really Calum and I are good friends. Heck even Bruce has my home phone number. many of (...) (21 years ago, 12-Sep-03, to lugnet.org.ca.rtltoronto)
| | | Re: My RCX is HAUNTED
|
| (...) You have to realize we're not at all fighting. We've somehow garnered an incredible ability to trash talk over the last few years. (...) Variables in your own code. The firmware is still handling all those IFs in the background. The pile of (...) (21 years ago, 12-Sep-03, to lugnet.org.ca.rtltoronto)
| | | Re: My RCX is HAUNTED
|
| (...) That code was just not elegant, but then script code are a lot harder to read than NQC. I would applaud if those code were machine generated by another code he wrote but they are not. If the target pattern is changed from X to something else (...) (21 years ago, 12-Sep-03, to lugnet.org.ca.rtltoronto)
|
Message is in Reply To:
| | Re: My RCX is HAUNTED
|
| (...) Well, let's see. Rob won the event...and I know he can program--or at least his dad can. Who didn't have a robot? Well, I brought one with Mario. Hrm. We can both program (He wrote the majority of the code, I wrote a small part on a secondary (...) (21 years ago, 12-Sep-03, to lugnet.org.ca.rtltoronto)
|
38 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|