3 ms·
Ask HN: effects of prefix notation on coding / thinking
Hi all. I was looking, and failed to find information on the net on what kind of effect coding in prefix notation has on the way you think, compared to infix notation.
I know that after a few months of toying with arc, the prefix notation seems to be clearer to my mind than similar code in infix (I still code in ruby at work), but finding anything concrete on the net about the effect of coding in prefix is tricky. I mainly run into blog-posts expressing a similar feeling.
http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis
http://www.frozenreality.co.uk/comic/bunny/index.php?id=919
- eru 18y agoHave you tried coding in postfix aka Forth, yet?
- bOR_ 18y agoLearning one language at a time =). Haven't tried postfix / Forth yet.. so I don't know how that would feel.
- silentbicycle 18y agoFactor (http://factorcode.org/ http://factorcode.org/) is another postfix / stack-based language that may be worth a look.
- bOR_ 18y agoHeard of it. But I was looking not for different languages to learn, but some kind of analysis on what the effect is on the way programmers think because of using an infix / prefix or postfix language. For example: I remember I heard somewhere that japanese kids are better in mental arithmetic based on the way the japanese counting system works (no clue if that's true, heard it ages ago). So it is the analysis of the effects I am after.
- deleted 18y ago[deleted]
- parenthesis 18y agoOf course, infix is (always/usually?) only for some operators (e.g. arithmetic ones), with everything else prefix, just usually written foo(x, y) instead of (foo x y), but prefix nonetheless.
- silentbicycle 18y agoSome languages allow an unambiguous mix of infix and prefix. OCaml & Haskell: 5 + 7 or (+) 5 7 Most non-alphanumeric operators are infix unless in parens. Haskell: map (\ x -> x + 1) [1, 2, 3] or (\ x -> x + 1) `map` [1, 2, 3] Two-argument, alphanumerically named functions can be made infix with `backticks`.