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

    Mark Seemann

    blog.ploeh.dk · Personal blog · on HN since 2012

    Mark Seemann writes about software design, dependency injection, functional programming, F#, and category theory, mostly for .NET developers.

    Visit blogRSSHN submissions
    ProgrammingLanguages & Compilers
    What HN says

    Commenters recommend his category theory series and book 'Code That Fits in Your Head', and cite his argument that Service Locator is an anti-pattern.

    Stats for nerds
    171HN people shared it
    155linked in comments
    3.6Kstory points
    Aug 2026last shared
    2013people per year2026

    Top posts on HN

    1. 1
      From Design Patterns to Category Theory (2017)
      14 people · 774 points · first shared 2017 · 75 comments on HN
    2. 2
      You'll regret using natural keys
      4 people · 748 points · first shared 2024 · 553 comments on HN
    3. 3
      We need young programmers; We need old programmers
      2 people · 332 points · first shared 2020 · 257 comments on HN
    4. 4
      The dispassionate developer
      3 people · 294 points · first shared 2021 · 255 comments on HN
    5. 5
      Fortunately, I don't squash my commits
      2 people · 281 points · first shared 2020 · 327 comments on HN
    6. 6
      The 80/24 Rule
      1 person · 170 points · first shared 2019 · 191 comments on HN
    7. 7
      Am I stuck in a local maximum?
      1 person · 136 points · first shared 2021 · 108 comments on HN
    8. 8
      Yes Silver Bullet (2019)
      7 people · 120 points · first shared 2019 · 72 comments on HN
    9. 9
      From dependency injection to dependency rejection
      9 people · 108 points · first shared 2017 · 33 comments on HN
    10. 10
      Less is more: language features
      6 people · 90 points · first shared 2015 · 63 comments on HN

    What HN people wrote when they linked it

    • vfaronovJul 2016

      > We're talking about REST best practices here, not "let's do RPC instead".

      I don't think so. Avernar above seems to argue against REST as an architectural style (RPC being the default as everybody uses it). I thought you were trying to defend REST with your example, and I wanted to point out a weakness in that example.

      > There's no reason for the webcam to hard-code URIs, and that's a violation of the architectural constraints.

      The webcam has to hardcode some URIs (entry points). Consider that it could be using other services: perhaps a social network to post updates on. Then it must hardcode another entry point URI. But at that point -- and since every resource is supposedly independent and only explicit relations matter -- why can't the webcam treat the "problem report service" and the "update frame service" as two entirely separate services to hardcode? Which constraint of REST does this violate?

      In your example, insisting that the webcam go through the entry point doesn't even buy the server a lot of flexibility. You reduce the client's knowledge from 2 URLs to 1 URL -- a URL that you may still want to change etc.

      An extra HTTP roundtrip every time can well be an unpleasant overhead. HTTP client caches are sparsely supported and notoriously complex (RFC 7234 is 41 pages long). Rolling your own cache is, well, rolling your own.

      And then there is the human problem. I was blown away by a discussion [1] where people reported using cryptography to prevent in-house…

    • ojnabieootNov 2019

      > FP people don't use the term "design pattern" often, but that's what most monadic stuff really is.

      This is exactly backwards. A monad is not a design pattern - a design pattern is an awkward manual reimplementation of a monad (or another category). In OO design patterns the structure behind what you're actually doing is buried under both the clunky type system of most OO languages and the arcane memorization of patterns and their names.

      The whole reason design patterns exist is that in C++[1]/Java/Smalltalk/etc the type system is not quite good enough to enforce consistency with certain complex designs - failure management in concurrent systems being an excellent tricky example. In imperative/OO-dominant languages there is inevitably a huge amount of boilerplate around checking nulls, lots of wrapping things in try/catches, and so on. Design patterns are an useful abstraction of this boilerplate in a way that's easy to maintain (and, more importantly, are an intutive common language for many programmers). But they are no substitute for categories, which allows the compiler to make sure the design pattern is actually properly implemented.

      But this stuff is quite complicated. It really does sound like a lot of navel-gazing mathy jargon. But the way you've phrased this makes me wonder - and I am aware this is condescending - if you haven't actually used categories in practice.

      My thinking on this has been strongly influenced by this excellent blog series from Mark…

    • dustinmorisAug 2021

      Observation from the real world:

      Functional programming seems to be extremely easy if you have never learned imperative programming first. I have seen beginners grasp FP much faster than OOP and write production ready code only after a few weeks/months of learning whereas beginners need on average multiple years to learn "production ready" design pattern style OOP.

      On the other hand I have observed some of the best OOP developers really struggle with FP. It's not that they find FP hard to learn, they find it really hard to unlearn OOP and the thinking that the way things are done in OOP is the holy grail of good software design.

      For example, only recently there was this blog post trending on HN (Am I stuck in a local maximum - https://blog.ploeh.dk/2021/08/09/am-i-stuck-in-a-local-maximum), which was triggered by a "blue tick" OOP programmer (tastapod on Twitter - inventor of BDD) making false statements about FP because he seemingly struggled learning it and wasn't able to work out how to program without mutations. He came to the conclusion that all functional programmers actually use mutations by default and immutable data structures are not common in FP at all. It was a completely unfounded assertion and clearly one made from frustration by someone who was so hard wired into OOP programming that they couldn't adapt to the FP way of thinking. It was a prime example of an "old dog" (citing the original article) finding FP harder than the new guys.

    • aswertySep 2024

      > This is such bad advice that I honestly couldn’t tell if it was a parody or not until I read the comment section—it’s not.

      There is a large body of content on why concepts discussed in the article are championed. And also a large body of content on how they are misused (and I agree that can be - even to a huge degree).

      So while, I think it is fine to judge that ascribed benefits are not worth the cost (or are not even realizable in a typical development team). Or argue why the benefits of an architecture like this doesn't work for Rust in particular - which may be the case since many of these patterns are oriented towards design in the enterprise applications space. But ascribing the approach as being a "parody" is not at all constructive.

      The patterns of hexagonal architecture isn't in any way coupled to OOP even if some of the terminology is highly aligned with languages in the OOP space. In fact the well regarded (at least by me) Mark Seeman has an article how Ports and Adapters, another name for Hexagonal Architecture, is inherently functional [1]. And this resonates with my experience.

      I have seen the pattern implemented well across: Python, Typescript, Javascript, .Net, Scala, and Go. And while the systems languages such as: C, Rust, and beyond are quite distinct from the previously discussed languages. There is certainly space for debate on the viability of the application of these patterns.

      [1]…

    • danidiazMar 2019

      This is usually called the classical vs. mockist, or test interactions vs. test final state debate.

      Instead of mocks, some people prefer to build fakes / stubs which are versions of a dependency which are "fully operative" in a sense but with a simplified internal implementation. For example a repository that keeps entities in memory. (Not the same as an in-memory database! The fake repository wouldn't use SQL at all.)

      Tests would check the final state of the fakes after the interactions, or simply verify that the values returned by the tested component are correct.

      The hope is that fakes, while possibly more laborious to set up, allow an style of testing that focuses less on the exact interactions between components, and therefore is less brittle.

      Some links:

      - Mocks aren't stubs https://martinfowler.com/articles/mocksArentStubs.html#ClassicalAndMockistTesting

      - From interaction-based to state-based testing http://blog.ploeh.dk/2019/02/18/from-interaction-based-to-state-based-testing/

    • cryptosSep 2019

      After reading "Functional architecture is Ports and Adapters" [1] and using ORMs (Hibernate) for some time now, I'm wondering whether a functional approach wouldn't be better in many cases. With such an approach you would have the following flow:

      HTTP adpater receives request -> object is loaded from database as immutable object -> business operation creates a modified copy -> DB adapter persists the new object.

      The last step could be improved if the DB adapter would look what was actually changed. Since everything is immutable it is as easy and fast as comparing references (like React does btw). This works even with Domain Driven Design, what is usually used with mutable entity objects.

      [1] https://blog.ploeh.dk/2016/03/18/functional-architecture-is-ports-and-adapters/

    Related

    F# for Fun and Profitfsharpforfunandprofit.com334 people

    Railway-Oriented Programming (2015)

    F# for Fun and Profit
    Personal · last shared 2026
    Hillel Waynehillelwayne.com294 people

    1/0 = 0

    Hillel Wayne
    Personal · last shared 2026
    Ted Kaminskitedinski.com52 people

    What can we learn from how compilers are designed?

    Ted Kaminski
    Personal · last shared 2026
    LispCastlispcast.com108 people

    React: Another Level of Indirection

    LispCast
    Personal · last shared 2022
    Matt Parsonsparsonsmatt.org57 people

    Write Junior Code

    Matt Parsons
    Personal · last shared 2026
    Coding Horrorblog.codinghorror.com2.1k people

    Farewell Stack Exchange

    Coding Horror
    Personal · last shared 2026
    Jimmy Koppelpathsensitive.com47 people

    The Benjamin Franklin method for learning more from programming books

    Jimmy Koppel
    Personal · last shared 2026
    Code of Robcodeofrob.com35 people

    You have ruined JavaScript

    Code of Rob
    Personal · last shared 2022