Hacker News new | ask | show | jobs
by marcosdumay 3732 days ago
If you have more than one layer with implicit mutable state, you are up for emergent behavior. It is not limited to FSM.

But FSM are just too easy, so people often use it to make implicit some state that would be explicit otherwise. In this sense, yes, they do cause emergent behavior.

The alternatives are joining your state at a single layer, making sure your states are really orthogonal to each other (very hard if both do IO), or making your state explicit so that you can at least verify once you find a problem.

1 comments

So don't make state implicit. This is critical. Orthogonality is just something you do.

I've found it offends some people, but it works and generally, their way doesn't.

But the founding principle is "trust no one" in distributed systems.

I wouldn't put it that black on white. Orthogonalising implicit state is just great for managing complex behavior. It's a very powerful tool, and it can be made foolproof on lots of cases.

But if two layers do IO, you'll almost certainly want the state to be explicit.

I don't think foolproof costs all that much, especially if it's habit. YMMV.

I have a BluRay player with Java(tm). If it sits more than a day or twenty, I have to unplug it, count to ten and plug it back in. I have a TV that has seizures - loud, painful seizures ( that always test the ability of an amp connected to it to defend itself ) . Scares the crap out of the dogs.

This is not necessary. This is not good.