4 ms·
I like Forth, I am aware of its shortcomings though there is one I haven't seen mentioned: the good practice with forth is factorization, i.e. splitting words i
by uncircle 1y ago
I like Forth, I am aware of its shortcomings though there is one I haven't seen mentioned: the good practice with forth is factorization, i.e. splitting words into small ones where stack juggling is rarely necessary. The enormous issue with this, not seen in other languages, is that all those words have to be named, and naming is well-known as one of the hardest things in computing.
What is a simple expression in C, for example, in Forth becomes half-a-dozen words which all have to be named, and it is an enormous productivity killer. Especially when doing maths, you would have to find a name for all the intermediate steps of an equation instead of simply doing:
float x = (-b + sqrt(4 * a * c)) / (2 * a * c);
- uticus 1y ago> ...you would have to find a name for all the intermediate steps of an equation instead of simply doing... Trying to understand this. Do you mean the operators in your example (-, +, *, /) would need to be named? If so, I agree one-off terms wouldn't make it a great calculator substitute. In fact, you'd probably end up doing equations similar to the RPN on some HP calcs [0] to get the order of operations correct - minus the handy physical +, /, etc buttons. But for programming, wouldn't you either assign the parts or the whole of the term to a word? [0] https://en.wikipedia.org/wiki/Reverse_Polish_notation https://en.wikipedia.org/wiki/Reverse_Polish_notation