Human-centric code design
I have spent a significant part of my career deeply frustrated. Not because my code did not work, but because of a contradiction I could not ignore. I have repeatedly encountered systems that behaved correctly, passed tests, and met their functional requirements, yet still felt fundamentally wrong when viewed as something meant to be understood, maintained, and lived with by humans over time.
More than once, I have taken apart working code, sometimes aggressively, not because it was broken, but because I could not accept the model behind it. I felt a responsibility not only for the solution itself, but for its understandability. That responsibility extends beyond other developers and teams. It applies just as much to my future self. Too many times, something that felt completely obvious at the moment of writing turned out not to be obvious at all six months later, not even to me. If the original author no longer understands the intent without effort, there is no reasonable expectation that anyone else will.
This tension has driven a long and sometimes exhausting internal struggle. How should systems be designed so that they work correctly and still remain understandable when context fades, pressure increases, and assumptions are forgotten? Over time, this struggle forced me to accept an uncomfortable but essential truth. The weakest link in any software system is not the compiler, the runtime, or the infrastructure. It is the human. Humans get tired, misinterpret intent, forget context, and make mistakes. Any approach that assumes otherwise is fragile by design.
What follows is not a best practice or a universal rule. It is the least problematic model I have arrived at through frustration, refactoring, and responsibility for systems that must survive change and time. It is an attempt to take human limitations seriously and to design code accordingly.
The design
Code is written for humans, not for tools. The compiler’s job is to translate it for machines. Until then, human understanding has absolute priority.
Recommended by LinkedIn
Code is written for humans, not for tools. Readability and ease of understanding are the primary goals, and all formatting, structure, and conventions exist solely to support them. This philosophy is grounded in a simple reality: humans are the weakest link in any system. People get tired, forget context, misinterpret intent, and make mistakes, often under pressure and with incomplete information. Code must therefore be written to actively support human cognition, not to assume ideal conditions or perfect attention.
This shift has already happened in user interface design. Modern UI and UX practices are built around how people actually perceive, process, and misunderstand information. Interfaces are designed to surface essential actions early, reduce cognitive load, avoid ambiguity, and guide users toward correct usage while preventing errors. Systems that rely on users “doing the right thing” by memory or discipline alone are considered poorly designed. The same human-centered principles apply equally to code: developers are users of code, and code should be designed with their strengths and limitations in mind.
Essential information should appear as early as possible, while secondary details should be deferred until they are needed. Control flow must be immediately obvious, ambiguity must be avoided, and the reader should not be forced to stop and interpret what the code “might mean.” Explicitness is preferred over cleverness. Small redundancies, such as consistently using this. for instance members, are not noise, but safeguards: they reduce cognitive load, remove ambiguity, and help prevent errors in real-world reading situations.
Formatting should respect the author’s intent and the way humans read text. Visual rhythm matters. Code should minimize horizontal eye movement, avoid unnecessary visual jitter, and present related elements in a balanced and stable manner. Automated tools must not rewrite structure or destroy meaningful layout decisions; they may only correct trivial issues such as whitespace or line length when strictly necessary. Consistency is desirable, but never at the cost of clarity. When trade-offs are required, clarity and unambiguous human communication always take precedence over uniformity, terseness, or typing convenience.
Code is a user interface for developers. Programming languages exist to help humans express intent to machines precisely; everything around them must exist to ensure that intent is understood unambiguously by other humans.
Tämä oli mainio kirjoitus ja palasin sen pariin nyt vielä uudestaan. Omassa työssä tekemäni ohjelmointi ei ole järin mutkikasta, mutta mielestäni tämä ajattelutapa soveltuu hyvin myös vaatimattomampaan puuhasteluun ohjelmoinnin parissa. Vaikutteita näkyykin jo tämän kuun omissa tuotoksissa - ja niiden pariin palaaminen on jatkossa mukavampaa 👍
Interesting perspective, Mika! However, I wonder if there are cases where prioritizing technical efficiency might outweigh human-centric considerations. What are your thoughts on balancing the two?
Olipas mukava kirjoitus ja hienoa, että vielä Joku ajattelee, että koodin kauneudella ja luettavuudella on arvoa ja se on viestintää ihmisten välillä eikä vain AI:n kertakäyttötavaraa, mustalaatikko jonka CI/CD/AI putki luo (ei-vielä-ihan)reaaliajassa. Kuten vanha kunnon MOV EAX, 0xffff jota harva ihminen enää näkee koskaan... Hyvää joulua Mika Karjunen!