-

@ Pip the social graph guy
2025-02-16 10:03:05
For simplicity I mean locality of behaviour and separation of responsibilities.
LoB means that a behaviour should be described and implemented in one single place, avoiding too many layers of indirections that makes it hard for future you (or others) to see the big picture. Every layer of indirection needs to be loaded into your "brain RAM", which takes time and it's lossy. A great quote is "before it runs on a computer, the program needs to run on your brain".
Separation of responsibilities means that a function should only do one thing. For example, one function that implement parsing, one function that validates what has been parsed, one function that process what have been parsed.
This makes it much easier to test code. This is important for me since I use TDD (test driven development), because honestly I am still a noob, so I prefer to test too much than too little.
Btw I fall in love with golang, which is a tremendously simple language with great guardrails, that make it easier to write good idiomatic code from the get go.