Post Reply 
Calculators you regret buying?
12-12-2023, 05:38 AM (This post was last modified: 12-12-2023 05:51 AM by carey.)
Post: #22
RE: Calculators you regret buying?
(12-11-2023 11:05 PM)Valentin Albillo Wrote:  ...Stack juggling is virtually incompatible with "readability".

True, and all too common in single-file RPL programs. However, the best practice for writing RPL, demonstrated beautifully by D. R. Mackenroth (of HP) in his book HP48 Programming Examples is to create a separate directory for each program, consisting of a main program that calls several small subprograms (similar to sound Forth practice). Mackenroth gives a simple example of computing the hypotenuse of a triangle where the main program <<GetA GetB ComputeH Label>> is just a series of subprograms (verbs) that employ minimal stack juggling. Nice and readable!

(12-11-2023 11:05 PM)Valentin Albillo Wrote:  ...so that the programmer can concentrate on the algorithms and high-level details of the task to solve

It is interesting that this goal of focusing on high-level details can now sometimes be met best, not in a programming language, but in an unlikely place -- non-programmable scientific calculators like the Casio fx-991CW or TI-30X Plus. Consider Newton's method of root-solving. Sure, one can write a program for Newton's method, but these remarkable $20 non-programmables allow writing the recursive algorithm directly, e.g., Ans - f(Ans)/f'(x)|x=Ans and every time EXE is pressed (after first entering a starting value) the next iterate appears. Note that the high-level algorithm is written and displayed directly (no programming required). A second example is calculating the sum of square roots of the first n integers. Instead of writing a 7-step program, these calculators' Sigma operator allows the high-level algorithm to be written directly, replacing loops with summations.
n
Σ √i =
i=1
Just to be clear, I'm not suggesting the trivial option of just replacing programming with built-in functions. Instead, these scientific calculators and their operators allow writing high-level algorithms directly using math instead of computer science.

In keeping with the thread, my regret is buying a few extra programmable calculators when a non-programmable scientific calculator can sometimes be more fun!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Calculators you regret buying? - ijabbott - 12-10-2023, 09:59 AM
RE: Calculators you regret buying? - carey - 12-12-2023 05:38 AM
RE: Calculators you regret buying? - Johnh - 12-11-2023, 03:28 AM
RE: Calculators you regret buying? - carey - 12-11-2023, 03:54 PM
RE: Calculators you regret buying? - ttw - 12-11-2023, 04:27 PM
RE: Calculators you regret buying? - cjsuk - 12-13-2023, 08:09 PM
RE: Calculators you regret buying? - Peet - 08-21-2024, 05:40 PM
RE: Calculators you regret buying? - Ren - 08-23-2024, 01:19 AM



User(s) browsing this thread: 3 Guest(s)