Tijmen - Software.

2024 #36: New CSS, Hexagonal Architecture & Complexity


At Print.com we were discussing a lot regarding the architecture of our application. Therefor I dipped into the Hexagonal Architecture a lot this week.

  1. Web Design Engineering With the New CSS | Matthias Ott | CSS Day 2024 Talk from Matthijs Ott (https://matthiasott.com/) who is maintainer of ownyourweb.site, which is a newsletter on indie websites. CSS is not the same. New features have been added in quick succession allowing new layouts and possibilities. Design tools have to keep up with CSS. Features are added to CSS faster than Figma. Figma, as example, would always be trailing.

    Viewport Fragmentation Static designs don’t work anymore as there is a device for each pixel. Check Viewport FYI for more information.

    Fluid Web Typography Let the font-size scale with the viewport. Use clamp to a minimum and maximum font size and prefer the size based on a percentage of the viewport.

    The scaling version of this: https://utopia.fyi/

    Color scales oklch is a color space that is designed to be perceptually uniform: oklch(70% 0.325 341.79) which allows for more vibrancy.

  2. https://threedots.tech/post/introducing-clean-architecture Low Coupling, High Cohesion is the main benefit of clean architecture. The pattern “Clean Architecture” comes in many flavors:

    • Ports and Adapters
    • Hexagonal Architecture
    • Onion Architecture etc. They all bring different ideas to the clean architecture but the main idea is to abstract away implementation details. We try to seperate concens by using namespaces, modules, packages and whole services. All are meant to keep related code together.

    The main idea is to abstract away implementation details. Thhis injection indicates the intention well

    trainingsRepository := adapters.NewTrainingsFirestoreRepository(client)
    trainerGrpc := adapters.NewTrainerGrpc(trainerClient)
    usersGrpc := adapters.NewUsersGrpc(usersClient)
    
     trainingsService := app.NewTrainingsService(trainingsRepository, trainerGrpc, usersGrpc)
    

    There is a package I have yet to try out to see if It can actually validate clean architecture well: https://github.com/roblaszczak/go-cleanarch

  3. https://olano.dev/blog/a-note-on-essential-complexity The author wants to discuss the notion of essential complexity. Arguably the most important duty of a software developer is to manage complexity. As most of the code we write is extending or adjusting existing code. So to make this easier we have to facilite those future extensions.

    Software complexity is the boundary of our productivity No Silver Bullet, Brooks. It is not possible to make a system not complex as some problems are inherently complex. In Out of the Tar Pat they call this “essential complexity”. We could make the problem more tuned towards the software that exists. We could even redefine the whole problem.

    This is true if we think about it. Usually at work, I try to manouver the problem so that that all parties are happy with a solution. We often reduce complexity by just removing it from the codebase. “Only one person used it in a month, it’s not worth maintaining it.”.