5 ms·
Why, if you don't have to, would you write the functions in reverse order of when they're applied?
by vinceguidry 2y ago
Why, if you don't have to, would you write the functions in reverse order of when they're applied?
- gloxkiqcza 2y agoPresumably because they’ve been doing so for decades so it seems logical and natural in their head while the new thing is new and thus unintuitive.
- dboreham 2y agoBecause it makes more sense?
- Mond_ 2y agoDoes it actually make more sense, or is it just more familiar?
- kortex 2y agoI would wager within a rounding error, all humans have a lifetime of experience in following directions of the form: 1. do the first step in the process 2. then do the next thing 3. followed by a third action I struggle to think of any context outside of programming, retrosynthesis in chemistry, and some aspects of reverse-Polish notation calculators, where you conceive of the operations/arguments last-to-first. All of which are things typically encountered pretty late in one's educational journey.
- amelius 2y agoConsistency is more important. If you ever wrote: a(b()) then you're already breaking your left-to-right/first-to-last rule.
- ndriscoll 2y agoThere are some math books out there that use (x)f. My understanding is (some) algebraists tried to make it a thing ~60 years ago but it never really caught on.
- hollerith 2y agoThere are, but they leave out the parens and use context to distinguish function application from multiplication.
- regular_trash 2y agoThis is a foolish consistency, and a contrived counterexample. Consistency is not an ideal unto itself.
- deleted 1y ago[deleted]
- nh23423fefe 2y agofunction application is right associative?
- tgv 2y agoIt's a bit snarky, but would you rather write FORTH then? So instead of draw(line.start, line.end); print(i, round(a / b)); you'd write line.start, line.end |> draw; i, a, b |> div |> round |> print;
- sph 2y agoStill too much syntax for a Forth. It should be line.start line.end draw i a b div round print