With this post I’ve taken a bit more of a practical turn compared to previous Post-Architecture posts: It’s more aimed at providing guidance to keep (early) architecture as simple as possible. Let me know what you think!

  • John@mastodon.social
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    @arendjr

    1. abstraction != indirection. Abstraction allows you to do a deferred architecture: store this user “somehow”. Indirection is just early architecture with more steps: MyUserDatabase class is coupled to one way of doing things - it’s concrete, not abstract.

    2. yet another article advocating ‘pure functional’ flavour, not a pure functional PL. Recommending purity in an impure language is like recommending memory safety in C. All the work is on the programmer.

    • AggressivelyPassive@feddit.de
      link
      fedilink
      arrow-up
      0
      ·
      4 months ago

      To 1), that’s unfortunately not entirely true. The real abstraction criticized is more like introducing a StorableEntity layer that’s provided by a StorableEntityBuilderFactory. So instead of providing a compartment with a stable interface, they introduce a mess of generalizations.

      Abstractions should be bulkheads, but in practice they’re often more like one of those beads-on-strings door decorations.

      • John@mastodon.social
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        @agressivelyPassive moving from ‘storing a user in postgres’ to ‘storing anything in postgres’ is a step up in abstraction. Same with moving to ‘storing a user somewhere’ or moving to ‘storing anything anywhere’.

        Moving from ‘storing an entity’ to ‘storing an entity via a FacadeBuilderFactory’ is not a step up in abstraction, it’s only an extra indirection.

        • AggressivelyPassive@feddit.de
          link
          fedilink
          arrow-up
          0
          ·
          4 months ago

          No, that’s my point. Providing the builder factory as an abstract way to construct an entity, it is an abstraction. It removes you from the actual detail, that’s an abstraction. But it also introduces extra complexity, which in turn negates the value of the abstraction.

          In reality, the intention is an abstraction, the result is often enough a bad abstraction that introduces more complexity and adds indirection.

          • John@mastodon.social
            link
            fedilink
            arrow-up
            0
            ·
            4 months ago

            @agressivelyPassive if you routinely call indirections abstractions, then ‘premature abstraction is the root of all evil’ holds. If you separate the two concepts, you might think differently.

            If my team’s codebase had a business logic class that had a concrete dependency on an EntityBuilderFactory, I’d vomit a little, but I wouldn’t delete it (can’t piss off too many people all the time). But I would route around the damage by allowing the class to depend on the EBF *or* something else.

  • HamsterRage@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    I’ve always heard of your “post-architecture” referred to as “evolutionary design”.

      • HamsterRage@lemmy.ca
        link
        fedilink
        arrow-up
        0
        ·
        4 months ago

        It goes really well with YAGNI. Also DRY without YAGNI is a recipe for premature over-architecting.

        This is also one of the main benefits of TDD. There was a really good video that I can’t find again of a demonstration of how TDD leads you to different solutions than you thought you use when you started. Because you code exclusively for one single requirement at a time, adding or changing just enough code to meet each new requirement without breaking the earlier tests. The design then evolves.