TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: effects of prefix notation on coding / thinking

2 pointsby bOR_over 16 years ago
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.<p>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.<p><pre><code> http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis http://www.frozenreality.co.uk/comic/bunny/index.php?id=919</code></pre>

3 comments

silentbicycleover 16 years ago
Some languages allow an unambiguous mix of infix and prefix.<p><pre><code> OCaml &#38; Haskell: 5 + 7 or (+) 5 7</code></pre> Most non-alphanumeric operators are infix unless in parens.<p><pre><code> Haskell: map (\ x -&#62; x + 1) [1, 2, 3] or (\ x -&#62; x + 1) `map` [1, 2, 3]</code></pre> Two-argument, alphanumerically named functions can be made infix with `backticks`.
parenthesisover 16 years ago
Of 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.
eruover 16 years ago
Have you tried coding in postfix aka Forth, yet?
评论 #303726 未加载