Re: Newcomer has questions Message #25 Posted by Ernie Malaga (Miami) on 6 Apr 2003, 11:45 a.m., in response to message #24 by James M. Prange
James:
I think you're missing my point.
> Why in the world would I want to store the argument in a local variable just to put two numbers on the stack before I put it back on the stack and never use it again? Why make things more complicated than they need to be?
As I mentioned in an earlier post, I wrote the example programs off the top of my head without testing or optimization.
>why would you want fancy formatting when a program's on the stack?
And that points to another design flaw. Programs are meant to be read by _people_, because they have to be understood by _people_ if they are to be modified, improved, or what-have-you. Removing the "fancy formatting" removes understandability and confuses the programmer. Good coding standards _require_ use of comments and indentation whenever possible.
Please don't take this as a direct attack against RPL. RPN is equally at fault -- it can't be indented or commented.
>If I really wanted to keep the program from being compiled, I could embed it within a character string and even keep comments in it
Come, now, who's making things more difficult than they have to be? 8^)
>RPL is simple and straightforward.
Debatable and subjective. It's equally possible to argue that RPL is complicated and convoluted.
>As long as I use a variable name descriptive enough that I remember what the program was written for in the first place
RPL variable names are, in practice, limited to 4 or 5 characters because more than that won't fit in a menu key label. Sometimes my HP-28C can't put more than 3 characters! One cannot be descriptive when limited to such short variable names. I should know -- I've been an RPG programmer for 20 years, and RPG II and RPG III program variables are limited to 6 characters. Yech!
>But I thought that the "RP" in both "RPN" and "RPL" stood for "Reverse Polish". Doesn't that mean arguments first, operator last? Notice how many of the arguments in your program come *after* the operators? Now that's what I call backwards.
As mentioned above, programs are meant to be read by _people_. People use human speech (with a given language) to communicate ideas. When you say "store in register 01" you use a verb in the imperative tense ("store") and an object or "parameter" ("in register 01"). That's the _natural_ way to speak. Like Yoda of the "Star Wars" saga, you can say "In register 01 store," but taking this backwardness as far as that doesn't clarify a program in the least.
For that reason, I feel that RPL is more backwards than RPN. IMHO, HP took Lukasiewicz's invention just too far. But, as you yourself said, "stick with what you like."
>And then add the lack of IR, crippled serial I/O, flakey keys, poor keyboard layout, lack of keyboard overlays, big ugly chunk of plastic over the display, hard to read lettering on the faceplate, numerous operating system bugs...
You just gave a precise description of the HP-49G! 8^)
-Ernie
|