Q:

Multiple dev orgs vs single, re SOQL (and other) Salesforce limits

There are many many threads debating Salesforce team development. One sandbox vs multiple (i.e, one per developer).
I would prefer to work in my own dev org, but I always decide against it when I remember the following scenario:

DEV1 works in sandbox1. He adds a call to a new method1 in the Account trigger before update handler. When all is said and done, the transaction includes 100 SOQL statements, and oh, I don't know... 6 seconds cpu time.
DEV2 works in sandbox2. He adds a call to a new method2 in the Account trigger before update handler. When all is said and done, the transaction includes 101 SOQL queries, and oh, I don't know... 6 seconds cpu time.

Each developer's work compiles and runs without issue. But then they merge into a shared dev sandbox, and, as now 201 SOQL queries will be run (not to mention running over the max cpu time), everything breaks.
What's the solution here? I say work in the same sandbox and communicate and plan accordingly. I can't think of a better way.
But does that scale? Can a company with 100 developers work in the same sandbox? Can they all communicate and plan accordingly? Is it practical? But if they don't.. they'll potentially hit the limits once they merge. Better work in the same sandbox and know earlier rather than later, no?

A:

Ideally, everyone should be in their own org. This is why we are given a ton of developer sandboxes, and why DX allows us to create many orgs daily.
The thing you're missing is source control and continuous integration (CI). See, how it should work is like this:
Developer A creates their trigger, commits it, and then it is deployed by CI to a staging org. Developer B also commits, and CI tries to deploy. With proper unit tests, deployment fails, so B can't commit. At this point, A and B need to coordinate efforts to get their tests passing.
At no point should failing code make it to QA, because the unit tests should pass before CI allows it.
If you are not currently using DX, you should learn about it, set up a repository, and start using it. Doing anything less will often result in lost code and productivity.

