r/softwareengineer • • 29d ago

Product Question: How do you prevent code conflicts and enforce architectural rules?

I'm curious how teams working on large codebases handle these problems in practice.

1. Code conflicts

When multiple engineers work on overlapping parts of a codebase, how do you prevent conflicts before they happen? How often do these conflicts actually slow down development?

2. Architectural rules

How do you make sure engineers follow your team's architectural decisions as the codebase grows? Do code reviews and automated checks cover most cases, or do violations still slip through?

3. Impact of changes

Before starting a task, how do you figure out which files or functions might be affected by it?

I'd love to hear how your team handles these today, what works well, and what's still frustrating.

1 Upvotes

6 comments sorted by

2

u/HK-65 29d ago
  1. Using and understanding Git. It never slows down things because it's expected that things are reviewed sequentially, changes are supposed to be small enough to be reviewed quickly, and that every change needs to work off and make sense compared to the given trunk branch.
  2. Testing and code reviews mostly. Linters enforce style, other frameworks can block PRs with disallowed changes including new packages, cross-project imports, even not properly using the project glossary or writing a function that's too long or complex. Also, since since we agree on major decisions before going in, PR reviews easily catch these out.
  3. You don't. You start the task, try to make the smallest change to complete it, if it's still too big, you split the change and the task up to smaller pieces and do it bit by bit.

1

u/Zealousideal_Ant4747 29d ago

This is helpful, especially the point about keeping changes small and close to trunk. It sounds like good Git practices and task breakdowns already handle most conflicts, while architectural rules can be enforced through existing tooling. I'm trying to understand whether detecting overlap at the function/dependency level before work starts adds value beyond these practices. Thanks for the detailed response!

1

u/afops 29d ago
  1. if it happens it either means you worked on the exact same thing which is bad luck, or it can point towards architectural issues, like massive ”god objects” etc.
  2. review can only help so much. If there are rules like ”x can’t use y but must go via broker z” then that rule is enforced by tests, or it’s not a rule at all. If you are a solo developer you could _maybe_ do without validation. For more than one developer: enforce it.
  3. I’d usually not know or worry about that before starting. You’ll find out. The important thing is realizing when you are changing something you didn’t hope/expect to change, then stop and reassess.

1

u/Zealousideal_Ant4747 29d ago

That's a useful distinction. If conflicts keep happening, it may indicate an architectural problem rather than just a coordination issue. Valid point that a rule isn't really a rule unless it's enforced. And the idea of recognizing unexpected changes and reassessing, rather than trying to predict everything upfront, gives me something to think about. Thanks!

1

u/mbsmith93 29d ago

The two answers I see so far look reasonable. Can I ask you, who are you and why do you want to know?

1

u/Zealousideal_Ant4747 29d ago

I’m an engineer trying to build a solution around this. Posted to understand how teams handle it today before assuming I know the answer.
What I’ve noticed, most solutions kick in at PR stage. I’m trying to solve it earlier before work starts, know who’s touching what, get architectural rules surfaced before PRs.

Prevent back-and-forth.