‹ BackHN Continuity

Thread

Effect 4.0

87 points · 70 comments · stevefan1999

  1. techn00 · · focus · HN ↗
    Effect looks so cool, but the only thing that is off-putting (for me) is the DI. I don't even mind the syntax.

    I just don't like these DI systems that pull stuff "out of thin air" auto-magically instead of just passing arguments.

    1. kiliancs · · focus · HN ↗
      This was me in the past too. But Effect's DI is only advantages, because it is all type safe, including that you _must_ provision the dependency. The result is all the benefits of prop-drilling (explicit) without its problems (now your whole execution tree must learn about this dependency in a leaf).

      Effect's type-safe DI simplifies application architecture (you now have a clear algebra that is interfaces + layer composition), promotes important architecture principles (e.g. it's a lot easier to compose within the application when components are not tangled because they have to pass "ambient" service props through), and as a result apps are a lot easier to maintain and evolve.

      This is the sort of guardrail that really matters in the age of AI, because AI can still mess things up, but the blast radius of messing things up locally is very different than sloppifying architecture—and makes the problem of slop itself more treatable.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.