Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    T

    Tom Moertel

    blog.moertel.com · Personal blog · on HN since 2007

    Tom Moertel writes about programming techniques, including functional programming, recursion-to-iteration, type-based design, Git tricks, and old game hacks.

    Visit blogRSSHN submissions
    ProgrammingLanguages & CompilersRetro Computing
    What HN says

    HN returns to it often for the Atari 2600 game-programming hack, which commenters call ingenious, and for older web-safety posts like Google Web Accelerator and unsafe links.

    Stats for nerds
    63HN people shared it
    52linked in comments
    2Kstory points
    Aug 2026last shared
    2009people per year2026

    Top posts on HN

    1. 1
      A Great Old-Timey Game-Programming Hack
      11 people · 1.1K points · first shared 2013 · 143 comments on HN
    2. 2
      Coders guide to good coffee
      4 people · 198 points · first shared 2007 · 96 comments on HN
    3. 3
      The second-order-diff Git trick
      5 people · 184 points · first shared 2013 · 41 comments on HN
    4. 4
      Sampling with SQL
      2 people · 178 points · first shared 2024 · 43 comments on HN
    5. 5
      Recursion to Iteration, Part 4: The Trampoline (2013)
      4 people · 122 points · first shared 2013 · 17 comments on HN
    6. 6
      How to change symlinks atomically (2005)
      2 people · 70 points · first shared 2016 · 63 comments on HN
    7. 7
      A coder’s guide to coffee (2002)
      3 people · 53 points · first shared 2013 · 62 comments on HN
    8. 8
      Perl saved my vacation
      1 person · 34 points · first shared 2009 · 14 comments on HN
    9. 9
      Wondrous Oddities: R's function call semantics [2006]
      2 people · 29 points · first shared 2007 · 4 comments on HN
    10. 10
      On the evidence of a single coin toss
      1 person · 17 points · first shared 2010 · 14 comments on HN

    What HN people wrote when they linked it

    • chriswarboAug 2021

      > > It's possible to implement anything correctly with dynamic types but the point is static typing makes it easier to do so

      > This is where the argument became circular and we can basically stop.

      I think any appeal to "easier" is inherently subjective. I've certainly tried to avoid making any such claims. Instead, I've mostly tried to argue that static types can forbid certain programs from ever running, and we can use that to forbid things like vulnerable SQL queries.

      > > It's possible to implement anything correctly with dynamic types

      > but apparently chriswarbo does not.

      I never said any such thing; besides which, it's trivially the case that anything implemented with static types could also be implemented with dynamic types, since static types only exist at compile time (they are "erased" during compilation), and hence every running program is dynamically typed.

      In fact, I don't think I've said anything about correct implementations at all. My point is that static types can forbid incorrect implementations. When it comes to security, that is much more important; i.e. I would much rather bang my head against a screen filled with compiler errors, than expose some insecure program to the harsh reality of the Internet.

      > The parent claim (by chriswarbo) was that, for example, SQL injection attacks were, in fact, incontrovertible proof that SQL injection attacks "are classic type errors".

      I've not claimed that (in fact, I'm stuggling to parse what that sentence might…

    • fhoxhJun 2011

      It is one of your primary duties to safeguard the best interest of your organization. Incontrovertibly, the best interest is not served by storing passwords in plaintext as this can result in grave harm to your organization.

      Accordingly, while I would not share any details with the outside world, I would advise you to strongly push the issue internally, from the position of an educator.

      Here are four articles that may assist you in composing a stronger series of arguments:

      https://www.owasp.org/index.php/Broken_Authentication_and_Session_Management

      http://cwe.mitre.org/data/definitions/256.html

      http://blog.moertel.com/articles/2006/12/15/never-store-passwords-in-a-database

      http://marknelson.us/2011/02/06/gawker-considered-stupid-criminally-stupid/

      You will want to further notate that the effort of implementing non-plaintext authentication really isn't terribly significant.

      What troubles me is this "most senior" programmer of yours. If storing passwords in plaintext is OK with him/her, meaning that he/she has a weak background in security engineering, I can't imagine that there aren't many additional severe security issues (SQL injection, XSS, CSRF, etc...). Most concerning of all though is that this "most senior" programmer seems disinterested in due diligence and is instead actively arguing against widely known best practices.

      If, after your strong push, management still is not motivated, personally, I would resign. I would not want to be professionally affiliated…

    • jonny_noogSep 2010

      That would be right assuming passwords were always encrypted - and we know that unfortunately even some of the biggest sites have been bitten by not encrypting passwords in their database[1] - but that's not actually the case I was thinking of when I said "brute forced".

      Here's one possible scenario: let's say that I happened to be a member of a website that unfortunately allows an attacker to hit their login form as many times as they like and as fast as they like with various username/password combinations, and by brute forcing this login page in this way, they manage to determine what my username/password actually is. Now the attacker does know my username/password for one website I belong to and - if they're smart and determined - it may occur to them that now they know one of my usernames/passwords they might use these details as a starting point in trying to brute force other accounts that I may have on other websites.

      I used to run these kinds of brute force attacks against websites back in the day when I had nothing better to do and before I had to work for a living. Often I was quite successful, but I wasn't targeting specific users and even back then I could tell that websites were getting more savvy in terms of detecting and defeating such attacks. So no doubt it would be harder to pull this kind of thing off now and it would probably depend a lot on which website(s) you targeted. But surely it wouldn't be impossible.

      [1]…

    • paganelAug 2011

      > Sorry, but this is bull. If you take any information, even if it's an email and password, data security is either tops on your list or you're abusing your users (even "only a hundred"; one is too many!). There is literally zero middle ground on this: you do it or you shouldn't be building web applications

      http://blog.moertel.com/articles/2006/12/15/never-store-passwords-in-a-database

      Needless to say, almost 5 years have passed and they're still around :) their traffic probably a couple of orders of magnitude higher. I was there when it happened, and yes, probably some Russian hacker or whatnot has my password from there, but that's not such a big deal because reddit doesn't know my name, doesn't have my CC number or any details related to my life.

      Now, were this to happen to a company that has a lot more information available about each and every one of us stored in one central place (think Google or FB), then things could get really nasty. And I'm not talking about stupid mistakes like the one from above, I'm talking about MITM attacks orchestrated by (vicious) Governments, or cyber-warfare, or just plain old NSA not having to bother to collect information from a myriad of places anymore, when they can just go directly to the source.

    • nandemoAug 2012

      I follow the guidelines quoted below. I use an old electric kettle: not very fancy, you just plug it in and it boils the water. There's no temperature control settings, but there's no need: the water comes out about 92C, which is just right. Note that 175F=80C is not hot enough, it's "supposed" to be over 90C. But try it for yourself a couple of times and see if you can tell the difference.

      I use a plastic pour-over filter and a manual burr grinder by Kyocera, which costs around U$25. I use coffee ground in the same day or in the previous day. In my experience this is what makes the biggest difference.

      I usually buy beans at an import shop that has good turnout, so I know the beans are fresh. But last time I ended up buying at Starbucks and it was... awesome. Really.

      If you follow these three guidelines and do nothing
      more, you will enjoy coffee better than you can find
      in most specialty coffee shops:

      1. Buy only whole-bean coffee roasted within the last
      few days.
      2. Grind it fresh, just before brewing.
      3. Brew it in a French press or a pour-over filter using
      fresh water, off the boil.

      http://blog.moertel.com/pages/coders-guide-to-coffee

    • thethirdoneMar 2017

      http://blog.moertel.com/ does a decent job of explaining some practical aspects for de-recursivying, but I'll give you a basic explanation of that plus a more theoretical answer showing that any computatble function can be written using only while loops and a stack.

      Practical:
      If we right all of are programs and tail-recursive (returning a recursive call or constant at the end of the prgram) programs they are easy to transform into simple while loops with no stack. The idea is instead of calling another function just restart the current one with the updated arguments.

      EX:

      f(n,x)=f(n-1,x+1)
      f(0,x)=x

      goes to

      while(n > 0){
      n--;
      x++
      }

      Other techniques such as trampolining and continuation passing style also help translate recursive functions into iterative ones.

      Theorectical:
      Think about Brainfuck or Turing machines, these computing frameworks can compute any computable function using only what amounts to while loops and infinite memory.

      Given then that we can produce arbitrary control flow using only while loops, we can reproduce how recursive calls are computed in computers with stack frames (provided by our stack).

    Related

    Conal Elliottconal.net156 people

    Can functional programming be liberated from the von Neumann paradigm? (2010)

    Conal Elliott
    Personal · last shared 2026
    Red Blob Gamesredblobgames.com199 people

    Hexagonal grids for games

    Red Blob Games
    Personal · last shared 2026
    LispCastlispcast.com108 people

    React: Another Level of Indirection

    LispCast
    Personal · last shared 2022
    Oliver Charlesocharles.org.uk45 people

    How I develop with Nix

    Oliver Charles
    Personal · last shared 2019
    Coding Horrorblog.codinghorror.com2.1k people

    Farewell Stack Exchange

    Coding Horror
    Personal · last shared 2026
    Hillel Waynehillelwayne.com294 people

    1/0 = 0

    Hillel Wayne
    Personal · last shared 2026
    Emil Ernerfeldtilikebigbits.com53 people

    The Myth of RAM (2014)

    Emil Ernerfeldt
    Personal · last shared 2026
    F# for Fun and Profitfsharpforfunandprofit.com334 people

    Railway-Oriented Programming (2015)

    F# for Fun and Profit
    Personal · last shared 2026