Re: The Joy of Keystroke Programming Message #4 Posted by Valentin Albillo on 10 Dec 2004, 5:08 a.m., in response to message #1 by Ben Salinas
Hi, Ben:
Ben posted:
"I am quite a big fan of keystroke programming, for its on-the-fly programming advantage."
I mostly agree, but mainly when comparing classic "keystroke programming" RPN versus all-object-oriented-and-structured RPL. As for other programming languages or styles, read on ...
"I was reminded of this a few days ago. In
Calculus we were going over Euler's Method and had a classwork assignment [...] and [I] quickly programmed Euler's method on my 32sii [ ...] I had finished within a few minutes. [...] To be fair, one of my friends (who is very big into comp sci) stayed and wrote his
own program as well, in TI-Basic for his 89. Needless to say, I finished much quicker than he did (of course his interface was probably nicer).
You're not being fair. I've never used a TI-89 and TI-Basic, but either that machine/language combination is very awkward to use or your "very-big-into-comp-sci" friend is not as efficient as you want him to seem, because, after reading your post, it took me a minute (give or take a few seconds) to write this plain-vanilla, 3-line implementation of Euler's method on HP-71B BASIC:
10 INPUT "X0,Y0,H=";X0,Y0,H @ DELAY .1,0 @ FIX 5
20 Y1=Y0+H*FNF(X0,Y0) @ X1=X0+H @ DISP X1,Y1 @ X0=X1 @ Y0=Y1 @ GOTO 20
90 DEF FNF(X,Y)=Y
where you define your y'=f(x,y) as a user-defined function in line (say) 90 (here, it is y' = y), and just input your initial conditions (x0,y0) and step size (h) when prompted.
The program runs non-stop, outputting each successive (xi,yi) at 0.1 seconds interval, rounded for display to 5 decimal places.
If it took you "a few minutes" to write an equivalent program for your "keystroke programmable" HP model, you see, you weren't that fast, after all.
The bottom line: against such easygoing, powerful languages as HP-71B BASIC, RPN keystroke programming is far, far, far from being the simplest, fastest way of getting things done. Not that I don't like RPN, mind you, but as they say, "to each his own".
Best regards from V.
|