[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Can we all agree that polish/prefix notation is objectively superior
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 22
Thread images: 3
File: sum fibonacci notations.png (6 KB, 612x158) Image search: [Google]
sum fibonacci notations.png
6 KB, 612x158
Can we all agree that polish/prefix notation is objectively superior to infix notation?
>>
silence means assent
>>
File: 1463948371086.gif (454 KB, 475x393) Image search: [Google]
1463948371086.gif
454 KB, 475x393
>>54823091
No that's stupid and unnecessary
>>
File: datboiterry.png (246 KB, 637x640) Image search: [Google]
datboiterry.png
246 KB, 637x640
>>54823091
I can agree with that, my brain finds it easier to work with and it's a lot more compact. The only problem is I can't use it in exams for some stupid reason...
>>
>>54823091
Lost a '2' there buddy
>>
>>54823091

No, it's better to have infix notation and 18 levels of operator's precedence.
>>
>>54823091
postfix > prefix
I will agree that both are better than infix though.
>>
Did someone just get done reading the first chapter of SICP?
>>
(* (/ 1 (sqrt (* 2 π ) ) sigma) (exp (* -1/2 (pow (/ (- x µ) sigma ) 2))))

Real superior. There's a reason we don't usually use it.
>>
>>54823091
Your example looks good because it has less operators so it's shorter. But how about this:
(3-5)*((7+2)/9)
Is the same as
(* (- 3 5) (/ (+ 7 2) 9))
I think it looks uglier imho desu senpai
>>
Top one looks like it'd be nice for situations like that one specifically - one operator, a bunch of things to operate on.

Multiple different operations would be a garbled mess to comprehend compared to using the bottom one.
>>
>>54823091
Yeah
>>
>>54823799
>>54823951
Why the fuck would you use parentheses with the polish notiation? The whole point is not having to write them.
>>
>>54823642
Do you also prefer your programming languages to look like (3, 2, 1, "%d %d %d").printLn.stdout
>>
>>54824316
No, there's a place for everything
>>
>>54824298
How would that anon write that equation as you describe it then? The only thing I can see you doing is removing the outmost parentheses.

Seriously curious.

The only way I could think of is this:
* / + 7 2 9 - 3 5
But the only reason it works is because of the Commutative Property of Multiplication.
>>
>>54824734
Basicly just omitting all of them works, so
* - 3 5 / + 7 2 9
works just as well
>>
>>54824734
Are you retarded? Post- and prefix are unambiguous. There are no more than one way to derive them.
>>
>>54824298
because * and + are n-adic functions.
>>
>>54824734
* / + 7 2 9 - 3 5
* / 9 9 - 3 5
* 1 - 3 5
* 1 -2
-2

>>54826021
* - 3 5 / + 7 2 9
* -2 / + 7 2 9
* -2 / 9 9
* -2 1
-2

----------------

Don't ask, I was bored.
>>
>>54826256
Afaik the elementary arithmetic operators are assumed to be binary.
>>
the only thing that matters is getting the right solution to a problem

how you get there doesn't matter
Thread replies: 22
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.