Skip to main content
Blog banner for Design Under Constraint

Design Under Constraint

Written on November 20, 2026 by Elliot Mackinnon.

Last updated November 20, 2026.

See changes
10 min read
––– views

Good Software Engineering Under Contracting Constraints

Software engineering often asks us to balance two competing priorities: building the right thing quickly and building it in a way that will remain easy to change. In theory, these goals should reinforce one another, but forces in the contracting world have a way of making these goals feel mutually exclusive.

When it comes to incentives, government contracting often seems to render its own laws of physics. Contracting itself, let alone government contracting, is a gravitational force that pulls efforts towards the mass of the immediate deliverable. A project has a statement of work, milestones, deadlines, and a customer waiting to see functionality delivered. Teams may be organized around individual contracts or task orders, and the people making architectural decisions today may not be the people maintaining the system tomorrow.

Private companies have a benefit of continuity; long term maintenance, ongoing refinement and the strategies surrounding this are less present in contracting. Contractors are often operating on parochial timescales driving one-off projects with multiple other companies who compete for the very same work. None of this is inherently bad, but it can create an incentive structure where the easiest way to satisfy the next requirement is to make the smallest possible change, even when that change pushes the architecture in the wrong direction. As any dev worth their salt could tell you, the architectural piper will eventually get paid.

The natural choice to kick cans down roads is easy to see; AI has only amplified this tendency. In contracting environments, architectural discipline should be thought of as a risk-management practice instead of a luxury. AI makes that discipline important because it lowers the cost of producing code without necessarily lowering the cost of understanding or maintaining it. There are two main disciplines that engineering teams can think about: organizational discipline and engineering discipline. We will take a look at how those show up in concrete ways in this article.

Good Design and Deadlines are not Opposite Forces

Recently, our team reached a point where we needed to implement new features that the existing architecture simply wasn't able to support. This was because we didn't really have an architecture, we had a duct-taped main handler function that ran everything (a God Object or Blob anti pattern) with little thought spared for organization or design. Every new PR added another Frankenstein-like appendage to its logic until it became extremely unwieldy, requiring us to take a machete and hack away in order to make single changes.

That pattern had been shaped by the requirements that existed when it was built. As those requirements were added to, assumptions that had once been reasonable became constraints. The natural response in a deadline-driven environment is to find a way around the constraint: Add another conditional. Put the new behavior in an existing class. Pass another flag. Introduce another special case. Duplicate a little logic because refactoring it would take too long.

In our new AI-driven world, these already-existent, simmering battles against introducing bad patterns have had jet fuel poured on them: it's hard to see what you're introducing when devs are shipping PRs that are impossible to fully vet due to size and velocity. Code development has shifted from first building mental models of well-designed systems that then gets implemented in code, to accepting from a menu of suggestions without digging around at the assumptions that lead to those items being included on the menu in the first place. We have to work a lot harder to stay in front of future tech debt problems now.

One problem we suffered from that became apparent to us: we did not have organizational discipline surrounding architecture.

Make Architecture Part of the Roadmap

When thinking to the future, the goal is not to predict it but instead make being wrong less expensive.

Important technical decisions should be made with the possibility that we may eventually need to change them. It's obvious why this is particularly valuable in contracting, where requirements, priorities, and even the boundaries of work can change on the fly. Remember, however, that perfect needn't be the enemy of good. There is no virtue in spending weeks designing an abstraction for a requirement that may never exist. All of this is a tricky judgement call at the end of the day, but flexibility and adaptability are key.

One practice that helped our team to establish organizational discipline was fairly simple: we introduced a recurring architecture-focused meeting whose cadence matched our roadmap. It's purpose was to have us deliberately look ahead and ensure our architecture and current design would support future requirements. This introduced some organizational discipline and we have been able to allocate time for roadmap-aware technical planning, architectural improvements to support more upcoming features, and discussion of requirements before implementation begins.

The right cadence for this organizational discipline will vary by team, but the important part is that architectural conversations happen before upcoming requirements become implementation problems. A backend team building a REST API has convention on their side, but a team building cutting-edge, greenfield AI bots certainly needs meetings like this at regular cadence. A few things to think about when setting up organizational architecture discipline:

  • Frequency: How often does your team meet? Does it align with sprint planning, quarterly roadmaps, or major milestones?
  • Participants: Is this just senior engineers, or should developers working on upcoming features participate?
  • Inputs: What does the team review? Upcoming requirements, technical risks, existing architectural diagrams, planned integrations?
  • Outputs: What comes out of the meeting? Architecture decision records, refactoring tasks, updated diagrams, technical spikes?
  • Follow-through: How do architectural decisions actually make it into the development backlog?

A natural follow on question is then: what does discipline look like at a lower level than organzational?

Optimize for Reversibility Using a Toolbox

Good design under pressure requires engineering discipline and a practical toolbox.

Developers should have a collection of patterns and techniques they can reach for when requirements begin pulling in different directions:

Architectural concernPotential techniqueBenefit
External service may changeAdapter patternIsolates integration-specific behavior
Multiple implementations of a capabilityStrategy patternMakes implementations interchangeable
High coupling between modulesDependency inversionReduces dependencies on concrete implementations
Behavior varies by environment or customerConfigurationAvoids hard-coded assumptions
Responsibilities are accumulating in one componentCompositionSeparates concerns into smaller units

This is closely related to the idea of orthogonality in The Pragmatic Programmer by Andrew Hunt and David Thomas: when parts of a system are sufficiently independent, changes can remain localized instead of propagating throughout the codebase. It is not good when to make one feature change or small alteration, you have to touch half the codebase. But the goal is useful separation; don't go crazy with your abstractions.

Contracting creates a particular kind of uncertainty. We are often asked to make decisions before we have perfect information about what the customer will eventually need. It's useful to ask yourself:

  • What assumptions are we making about this requirement?
  • If this assumption turns out to be wrong six months from now, how hard will it be to change?
  • Which parts of this implementation are likely to change?
  • What would it cost to replace this dependency?
  • Does this design make the next likely requirement easier or harder?
  • Are we introducing complexity to solve a real problem or a hypothetical one?

At a certain point with contracting, it really becomes about risk management: we want to reduce the pain points of our team, our client and our project. Requirements and environments change, so software should avoid treating today's decisions as permanently correct.

This brings us to another point of impact on our discipline: AI. Unless you live under a rock, you'll have used it or are familiar with it in the last few years. Without staking any opinions on the controversies surrounding it, we can certainly talk about a few effects it has on everything this article has talked about so far.

The New Risk to Discipline: AI Makes Bad Design Easier

For all the good (or bad, depending on who you ask) AI can do for software development, it absolutely, unequivocally shifts the paradigm. Previously, manually writing code meant manually designing it and manually wrapping our brains around mental models that we shaped with hard effort. That entire effort inherently forced confrontations with our decisions. If we were chefs, we were measuring, kneading, chopping, tasting and thinking about what the final dishes in our 4 course dinner would be constantly. With AI, we have a magic microwave: "Hey magic microwave, make me a 4 course meal, I'll leave the details to you".

You can see how the process means less time spent intimately shaping our mental model, or how being so removed from the process makes decisions about tradeoffs or patterns more effortful (you have to read and understand code that you didn't write, every dev's least favorite thing). To top it off, AI can be wrong in ways that aren't immediately obvious. We all know what code smells are. AI is pretty good at introducing those if you don't take pains to babysit it. I have found it can give you an approach that works for the feature in front of us while introducing unnecessary complexity, coupling, or assumptions that make the next feature substantially harder.

We already have incentives to move quickly and satisfy the immediate requirement. AI can make it even easier to optimize for such because the implementation now only takes a prompt to the magic microwave.

AI isn't going anywhere, so the real fix is to be disciplined in supervising it and learn your design patterns. Maybe we won't be as involved in the creation of an implementation as we were before AI, but we can still be responsible for our understanding of an implementation. Getting in front of the subtle coupling and code smells is easier when you have a pattern in mind to help abstract your modules away from each other. It may mean a little more mental effort upfront, but it will probably mean reduced headaches in the future. A few practices that have helped me:

  1. Establish the design before prompting. Identify the relevant components, interfaces, constraints, and intended responsibilities before asking AI to implement something.
  2. Constrain the implementation. Give AI architectural boundaries and explicitly identify patterns or existing abstractions it should follow.
  3. Review the diff at the architectural level. Don't just ask whether the feature works. Ask whether it introduced new coupling, duplicated responsibilities, or unnecessary abstractions.
  4. Keep changes reviewable. Break large AI-generated changes into smaller, independently understandable units.
  5. Validate assumptions. Ask AI to explain why it chose a particular design and what alternatives it considered, then independently evaluate that reasoning.

Good engineering is recognizing that architecture and design are part of the tools that we use to meet deadlines repeatedly. The best codebase for a contracting environment isn't necessarily the most elegant one, or the one with the most sophisticated architecture. It is one that can absorb changing requirements without requiring the team to fight its own previous decisions and makes being wrong cost less.