How to Create 10x More Maintainable Code

How to Create 10x More Maintainable Code

“Technical debt” is our means to measure how maintainable our software projects are. Others will strongly disagree with me here, but there’s no room for disagreeing. We already have tons of science in the subject, and technical debt grows on average proportional to the number of lines of code your solution contains. This implies that less lines of code equals a higher degree of maintainability.

The reason for this is because our brain can only keep a certain amount of complexity in its conscious parts at once. When you increase LOC count, and start separating your concepts into multiple files, the size of what you need to put into your head to understand the “whole” grows. And as it grows, it becomes mentally impossible for us to keep track of everything at once.

Separation of Concerns

Even though we try our best to separate our code, such that each file only contains one “concern”, the end result becomes we need to touch upon 4 or 5 files to edit a simple CRUD read endpoint. To illustrate the case, realise that this Hyperlambda code ...

http.get:"https://api.somewhere.io/api"
   convert:true
   headers
      Authorization:Bearer BEARER_TOKEN_HERE
data.connect:crm
   for-each:x:@http.get/*
      data.create
         table:contacts
         values
            name:x:@.dp/#/*/name
            email:x:@.dp/#/*/email        

… needs 8 files and 87 lines of code in its C# solution. Hyperlambda 11 lines of code in one file. C# 87 lines of code in 8 files. Watch the following video to understand why that is a problem.

Facts are, if you’re an average software developer, you’re probably separating your concerns wrong. Yes we should separate our concerns, but separating your “service implementation” from your “persistence layer” is overkill 99% of the time. Separating your concerns in a healthy and clean way, implies having all the code related to one aspect of your app in one file, and all code related to some other aspects in another file.

Need to send an email? Cool, one file, not 8 as is demanded by our “best practices”. That way when you’ve got a bug in your code, or you need to modify it to add another feature, you can see all code related to the issue at hand in one file. This allows you to “upload” one concern into your brain as you start maintaining your code, and keep the entire context required to understand the code as you are maintaining the code. This is such a self evident fact it puzzles me that devs are still arguing …

Other software developers will violently disagree with me here, but even if 30 million people are telling you lies that they read about in some 30 year old book, accepted as “dogma” by the industry, their lies are still lies.

The belief in SoC is the worst thing that’s happened to our industry for the least 30 years

And the reasons for that is because most of us aren’t building Facebook or Twitter, we’re creating business administration apps, as enterprise software developers, and the statistical probability of that we’ll at some point “change database” is roughly equal to 0. However, by “anticipating that need”, and creating YALOA (Yet Another Layer Of Abstraction) using OOP mechanisms, instead of making the code more easily maintained, the result becomes the exact opposite.

If you create code that’s 10% of your current codebase, the resource requirements to maintain that code drops by 90%. This implies that you should always strive for creating less verbose code. 10x as much code, equals 10x as much technical debt.

To see how we’re dealing with complexity, you can check out Magic Cloudhere, or visit our company website here.


Separation of Concerns is good if it's a 100% clean division of responsibility like using an HTTP library, the TCP/IP stack etc. It's not a good idea if it requires you to build 1000s of little, badly engineered, abstractions yourself. Domain specific languages (which are also SoC, but using a giant wall instead of tons of little one) are often the sweet spot, and they allow both AI and humans to be much more productive. I haven't seriously tried Hyperlambda yet but it looks like it's very suited to that.

Back again 😄 If fixing a bug requires changes in 8 files, that’s a clear sign of poor separation of concerns! Loose coupling and high cohesion are fundamental, tech-agnostic principles in system design - software being the most composable of systems. Bugs should trace to a small, isolated function - easy to hold in human working memory with minimal cognitive load. For example, is the issue in the HTML generator, the email service, or the HTTP client? Separation of concerns lets us reason one layer or module at a time, avoiding overwhelming complexity. It’s like troubleshooting a phone that won’t charge - you try another socket. This quick, layered debugging relies on proper SoC and IoC. Check out the trade-offs between efficient and resilient systems. Monolithic functions may be fast initially (both in runtime performance and developer efficiency), but beyond a local maxima, resilience favors modular designs. I think your last point aligns here, it’s just a matter of agreeing where that maxima lies.

Like
Reply

Could not agree more. People taking SoC and DRY as gospel have created more mess than they have avoided otherwise.

Oh. I read SoC as System-on-Chip 🤣

To view or add a comment, sign in

More articles by Thomas Hansen

  • My experiences with manually creating almost 50,000 training files for fine-tuning OpenAI GPT-4.1-mini

    In 2025 I manually curated a dataset of 46,787 Hyperlambda files (my DSL) to fine tune OpenAI's GPT-4.1-mini.

  • 90% of AI Agent Vendors are Scams

    A week ago Gartner published a report that concludes with that more than 90% of AI Agent vendors are scams, and that…

  • Smoking Google, Anthropic, and OpenAI on their home turf

    If I asked you about who's got the best AI in the world, you'd probably answer Google, Anthropic, or OpenAI. You might…

    3 Comments
  • How to become Over Employed

    On my YouTube channel I've got about 100+ videos proving how your current software development tools are basically…

    17 Comments
  • Facebook's Offering OpenAI Employees 100 million dollars

    According to Sam Altman Meta has been desperately trying to head hunt AI talent lately, to the point where some…

    1 Comment
  • Why your AI Chatbot Sux

    An AI chatbot that's correctly configured can result in up to 338% increase in conversions according to our research…

    2 Comments
  • OpenAI's o3 model price dropped by 80%

    I woke up to the news that OpenAI had decided to reduce the token price of o3 by 80%. This is great news for everyone…

    2 Comments
  • Never, Ever, Ever Accept Advice

    If you share your idea with others they will give you advice. This is a part of human nature, and their advice is…

    5 Comments
  • The Pragmatic Developer would have used Hyperlambda

    The last couple of days I've been comparing Hyperlambda implementations towards its C#, Rust, GoLang, and Python…

    1 Comment
  • Micro Service Madness

    Micro services is the false belief in that by adding a message broker to your app, it will somehow magically become…

    3 Comments

Others also viewed

Explore content categories