#160659 - zzo38computer - Sat Jul 19, 2008 6:26 pm
Quote: |
Forth Vs Lisp on c2 wiki
Lisper: "Obviously, all right-thinking functions should be on the left:
multiply must be prefix!"
Forther: "Heresy! Functions should be on the right,
multiply must be postfix!"
C/Java Onlookers: "Wha...? Both of you guys are weird,
infix multiply is the only way to go!"
Lisper and Forther, in unison: "Kill the blasphemers!"
|
Which do you prefer? prefix, postfix, infix. Please give the reason if you have one.
I like postfix and the reason is because: First you have to compute the value of what is being multiplied, and then you have to tell it to multiply those two numbers together. Right? It makes sense to me!
_________________
Important: Please send messages about FWNITRO to the public forum, not privately to me.
#160663 - Joe_Sextus - Sat Jul 19, 2008 8:38 pm
I have to go with postfix. I had to use it on for registration on a Windows Mobile application and it really made it a lot easier to visualize the key generation process.
#160665 - DekuTree64 - Sat Jul 19, 2008 10:12 pm
I like infix. That's how regular math is taught, so it feels more familiar when learning programming. Also it just seems more natural to me to put an operator between the two things it's affecting, and it requires less parentheses too.
Prefix is not bad either though. It matches better with calling named functions, and gives you more information about the purpose of the values upfront.
Postfix seems backward to me. "Here are some values, now do this with them." It doesn't really matter on simple expressions, but it seems like it would take more re-reading if you have a few nested operations.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku
#160671 - Dwedit - Sat Jul 19, 2008 11:24 pm
postfix is for stack machines. Push 5, Push 3, call * which pops two arguments and pushes one.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#160682 - sgeos - Sun Jul 20, 2008 7:38 am
All of the above. It depends on the situation. Whatever is easiest for "normal" human beings to understand.
-Brendan
#160691 - tepples - Sun Jul 20, 2008 12:47 pm
And that can depend on the user's native language. I know Welsh tends to be prefix (verb subject object), and Japanese to be postfix (topic subject object verb). German is circumfix for main clauses (subject-or-adverb helping-verb subject object participle).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.