Mahamudul Hasan Rubel
HomeAboutProjectsSkillsExperienceBlogPhotosContact
Mahamudul Hasan Rubel

Senior Software Engineer crafting high-performance web applications and SaaS platforms.

Navigation

  • Home
  • About
  • Projects
  • Skills
  • Experience
  • Blog
  • Photos
  • Contact

Get in Touch

Available for senior/lead roles and consulting.

bd.mhrubel@gmail.comHire Me

© 2026 Mahamudul Hasan Rubel. All rights reserved.

Built with using Next.js 16 & Tailwind v4

Back to Blog
LearningJune 21, 20264 min read

Mental models for software engineering to build better systems

Mental models for software engineering help you write cleaner code and design resilient systems. Learn how to shift your perspective for better results.

software engineeringmental modelssystem designdeveloper productivitylearningBooks

When I first started writing code, I treated software development as a series of syntax hurdles. If I could just get the compiler to stop screaming and the tests to pass, I assumed I’d succeeded. It took a few painful production outages—one involving a recursive loop that consumed about 4GB of RAM in under sixty seconds—to realize that syntax is the least of our problems. Writing better software isn't about knowing more frameworks; it’s about refining the internal mental models for software engineering you use to reason about complexity.

Why mental models for software engineering matter

Most of us learn by rote. We memorize that a hasMany relationship in Laravel Eloquent Relationships: A Guide to Linking Data Models works a certain way, or that Docker for app developers: A mental model that sticks involves isolating processes. But rote knowledge is brittle. When the environment changes or the requirements shift, the memorized solution often breaks.

A mental model, on the other hand, is a simplified representation of how a system works. It’s the "why" behind the "what." When I started viewing our backend not as a collection of endpoints, but as a series of state transitions, my code started looking entirely different.

The power of feedback loops

One of the most transformative shifts in my career was embracing the concept of feedback loops. Early on, I was obsessed with "getting it right the first time." I spent days architecting systems on whiteboards before writing a single line of code.

Inevitably, the code didn't match the whiteboard.

I learned that the faster I can get a piece of logic in front of a real user—or at least a real test suite—the faster I can correct my faulty assumptions. I now apply the principles I discussed in How I learn a new technology fast: A Pragmatic Engineer’s Guide to my daily development. Instead of building the "perfect" feature, I build the smallest possible slice that provides value.

If I'm designing a new data ingestion service, I don't build the full queueing system on day one. I write a script that reads from the source and logs to a file. It’s ugly, but it gives me an immediate feedback loop on the data structure.

Thinking in trade-offs

Every technical decision is a trade-off. There is no such thing as a "best practice," only "best for this specific set of constraints."

When I look at CQRS with Materialized Views: Scaling Laravel Read Models, I don’t see a "correct" way to scale. I see a trade-off: you gain read performance and architectural decoupling, but you pay for it with eventual consistency and increased operational complexity.

Before I commit to a design, I force myself to write down three things:

  1. What does this buy me?
  2. What does this cost me in terms of maintenance and cognitive load?
  3. What happens if this fails?

If I can’t answer the third question, I’m not ready to write the code.

Abstraction leakage

A common trap is assuming that our abstractions are perfect. We use ORMs, high-level APIs, and cloud services to hide complexity. But abstractions leak.

When you use an ORM, you are still ultimately talking to a database. If your mental model assumes the ORM magically handles performance, you’re in for a surprise when you hit an N+1 query problem. My rule of thumb: if you don’t understand how the abstraction works at the layer below, you shouldn't be using it. I’ve spent more time than I’d like to admit debugging "magic" that turned out to be a simple misunderstanding of how the underlying driver handled connections.

FAQ: Improving your mental models

How do I know if my mental model is wrong? The most obvious sign is when you find yourself fighting your tools. If you’re writing complex hacks to make a framework behave in a way it wasn't designed for, your mental model of that framework is likely misaligned with its core philosophy.

Should I stop learning new frameworks? Not at all. But shift your focus from the syntax to the underlying patterns. Once you understand the pattern—like Dependency Injection or Event Sourcing—you can see it repeated across every language and framework.

How do I practice this? Next time you encounter a bug, don't just fix it and move on. Ask yourself: "What did I assume about this system that turned out to be false?" That gap between your assumption and reality is where you update your mental model.

Final thoughts

I’m still refining these models. Sometimes I get overconfident and skip the prototyping phase, only to regret it when the architecture crumbles under load. The key isn't to be perfect; it's to be aware of how you're thinking. The mental models for software engineering that I rely on today will likely evolve as I encounter new problems, and I’m perfectly okay with that. After all, the best engineers I know are the ones most willing to change their minds when the evidence demands it.

Back to Blog

Similar Posts

Stylish desk setup with a how-to book, keyboard, and world map on paper.
LearningJune 20, 20264 min read

How I learn a new technology fast: A Pragmatic Engineer’s Guide

How I learn a new technology fast involves a repeatable, three-phase framework. Stop watching tutorials and start building to master new stacks efficiently.

Read more
AI/MLJune 21, 20264 min read

LLM Fallback Strategies: Designing Resilient AI Architectures

LLM fallback strategies are essential for production AI. Learn how to design a multi-model architecture that manages latency and API costs during outages.

Read more
CareerJune 21, 20264 min read

Software career lessons learned over twelve years of engineering

Software career lessons are best learned in the trenches. I’m sharing twelve years of experience on avoiding burnout, freelancing, and staying relevant.

Read more