4 ms·
I honestly don't think this is true. The word invariant might not be part of their toolbox, but that doesn't mean they don't understand what a condition that ho
by s-shellfish 8y ago
I honestly don't think this is true. The word invariant might not be part of their toolbox, but that doesn't mean they don't understand what a condition that holds true over some problem space implies. These things are built into existing infrastructure, they are bound to easily be rediscovered, noticed, understood.
I think the bigger problem is that when people work in large groups for implementing a business logic, things are assumed invariant in one component of a system, not tested for in another component that relies on that condition, and what used to work ceases to work when that condition changes.
If it literally isn't labeled "invariant" explicitly in some documentation, people learn to practice 'defensive programming', after enough frustration. Or they feel compelled to understand all the code in their code base, or migrate over to smaller companies, smaller projects where this is less of a headache (but not really, because we all depend on pieces of systems we can't always inspect in totality, therefore, can't always assume we know everything about the systems we are dependent on).
The real world has edge cases. If the instructions are wrong, it's because either the invariant isn't actually an invariant in the real world, or the domain is modeled incorrectly. The higher up you get in writing programs about programs, the less likely it seems like real world data works this way, because you literally don't even have the common sense or perspective to see that some things change without being able to specify an underlying order to them (implying some things change without there being an order to describe their changing).
- syastrov 8y agoIt’s a really important distinction that the invariant has to be an invariant in the real world (e.g. in the problem domain). Programming “right” is context-dependent. Some programmers try to program to some theoretically correct ideal, even if it doesn’t apply to their particular problem. Or, they may try to make invariants for things that they think they will need to hold true (possibly because of some future requirement). All of these can lead people to shy away from having any form of invariants. Agreeing on what invariants exist in the problem domain at a given time is really important for avoiding confusion. That kind of discussion happens all the time with teams who collaborate well and across disciplines. “Should it possible for that menu and that modal dialog to be open at the same time?” (Invariant) “A post can’t be published if it hasn’t been reviewed.” (Precondition) “After submitting a payment, an audit log entry must be created” (post condition)
- TeMPOraL 8y agoThere aren't many invariants in the real world - beyond literal laws of physics, things that seem invariant are usually enforced by the threat of jail. So in the end, the only real invariants we can use are part of our business model - not the real world - and they only hold insofar our model is specified and implemented correctly.
- deleted 8y ago[deleted]