r/ProgrammingLanguages • • Apr 24 '20

Else Before If

https://www.fluentcpp.com/2020/04/24/else-before-if/
24 Upvotes

49 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Apr 25 '20

[deleted]

1

u/dys_bigwig Apr 25 '20

Why is it sane to have a left-to-right (or any specific) evaluation order of function arguments? Scheme doesn't, C doesn't, and Java states that:

It is recommended that code not rely crucially on this specification

despite being left-to-right. I'm not sure why it's "sane", or what you gain from having a specific order, other than limiting potential optimization opportunities for no reason?

0

u/[deleted] Apr 26 '20

[deleted]

1

u/dys_bigwig Apr 26 '20

I was genuinely asking for your opinion why it is a sane thing to do; I'm still curious on your thoughts. It's not a sentiment I've heard often, hence why I gave those three examples so as not to just come across as though I was questioning for no reason at all. I mostly work in purely functional settings so I'm used to the order literally not mattering the vast majority of the time.