advantages of RPN
|
05-23-2014, 02:30 AM
(This post was last modified: 05-23-2014 02:31 AM by Garth Wilson.)
Post: #18
|
|||
|
|||
RE: advantages of RPN
(05-22-2014 09:44 AM)Nigel (UK) Wrote:(05-22-2014 01:25 AM)Garth Wilson Wrote: However, the algebraic one cannot re-use intermediate parts of the equation without storing them in a variable for later retrieval; whereas with a stack, you can dup it. Things get hairy when you have lots of parts of a program needing temporary variables. Is a particular one free at the moment, or will I step on something still needed by a pending routine? It may be fine now, but what happens if I have to come back later and modify it? Did I document well enough which ones were used where, and when, or will it mess up and then a part I didn't touch quits working, because I used its temporary variable in my other modified routine? It can be a debugging nightmare. A stack reduces the need for variables, and makes program maintenance much easier. These temporary variables cease to exist when they're no longer needed. What I meant was when you need a portion again in the same equation, like (a+b)/(a+b+c) for a simple example. Alvaro Wrote:Let me say like this: There are much better options. I have two HP-71's, which, with the math module and the LEX file contributions from the users' groups, have by far the best BASIC I've ever seen; yet for math-type programming, I still prefer the 41. I write the programs in a text editor on the PC though, so I can group associated instructions on a line, indent loops, add comments, etc., before keying them into the 41. Then they usually work on first try, unlike the situation with the 71. When I try to do things on the 71 in BASIC, my debugging partly consists of counting parentheses to figure out why it didn't like what I typed in. It can be a bit difficult sometimes. I'd rather do it in RPN, and I have no trouble keeping the image of what's happening on the stack in my mind. Even my assembly-language programming for microcontrollers for commercial products is becoming RPN-like, with stacks. I really don't want any more algebraic languages. I'm done with them. People don't all think the same; but although different languages might me more natural or unnatural for different people, I think people can gain skill in something that was previously unnatural. I understand RPN is very natural for native Korean speakers, because their spoken language is very RPN. http://WilsonMinesCo.com (Lots of HP-41 links at the bottom of the links page, at http://wilsonminesco.com/links.html#hp41 ) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)