Hacker News new | ask | show | jobs
by JoshuaAshton 1822 days ago
b sqr 4 a c * * - sqrt

Yeah no. This being "bug free" seems like a joke.

2 comments

I don't see an objective reason this is more or less clear than

    sqrt(sqr(b) - 4 * a * c)
or

    (sqrt (- (sqr b) (* 4 a c))
Honestly, by objective measures the traditional style is probably the worst. The Forth style makes it easy to see large stacks because you'll see long sequences of literals. The sexp style makes it easier to work with subexpressions. Both the Forth and sexp style don't require remembering PEMDAS. The sexp style is easier to parse, and the Forth style doesn't even need a parser.

The only thing going for the traditional style is that it is an ugly approximation of mathematical notation - but that notation itself loses most of its value in the uglifying.

This is just a "minor usability issue". Seriously. In Factor, you can solve this with references to local variables, which under the covers manipulate the stack as needed. It can also typecheck, so you wouldn't be able to write the expression in a way which unbalances the stack.