[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [NOISE] Curly braces [was Re: Curl]
What about postfix?
>From a user interface perspective, HP successfully convinced many people
to use Postfix calculators. Forth and Joy use it at the language level.
The great thing about postfix is you get rid of both precedence and
parentheses, which makes code look much cleaner and allows you to arrange
it in any way you like to enhance readability.
But, this is not just a syntax issue. Postfix protects you from a large
class of errors associated with variables and destructive update.
Postfix languages don't have variables. Values are simply placed on the
stack and operated on. All functions are just operations on a stack.
So you immediately eliminate the large class of errors that come from
destructive updates to shared data structures without having to jump
through all the hoops that functional programming languages force on you.
You also eliminate all errors associated with variable scope because you
get rid of variables.
The result is languages that are easier both to implement and to program.
-Alex-
___________________________________________________________________
S. Alexander Jacobson i2x Media
1-917-783-0889 voice 1-212-697-1427 fax
On Fri, 30 Nov 2001, Christopher Barber wrote:
> > Infix almost always makes it easier to transcribe a math formula into a
> > computer program, but relative ease of readability/debugging/
> > understanding is debatable. IMO.
>
> No one is taught math using prefix notation, so forcing them to learn it is
> a barrier to usability. I suppose it is possible that given enough
> experience with its use, you might become proficient enough to grok it as
> easily as infix, but why force humans to do what computers can do easily?
>
> I also would not underestimate the importance of having formulas look the
> same as they do in a book. Not only does it lower transcription errors, it
> also makes it easier for people reading the code to verify that the correct
> formula is being used.
>
> - Christopher
>