Re:Attitudes That Lead to Maintainable Code
by jrs235 on Wednesday March 08, 2017 @10:35AM
(#13820906)
>As for SOA, one thing Factorio taught me was the value of back pressure. Why spend resources producing materials which aren't being consumed? Conveyer belts and movers show the value of backpressure nicely - when the belt is full, movers stop placing items on the belt. The factories stop producing, and thus stop consuming intermediate materials... all the way back to your miners. But the moment that belt starts to clear up, the entire mechanism swings back into work, with enough queued materials to ensure that you are not suddenly starved.
This bit of your comment reminded me of The Goal: A Process of Ongoing Improvement[1] by Eliyahu Goldratt. It's a great fictional story/book that does an excellent job of teaching about bottlenecks and the Theory of Constraints. Specifically how to identify them and eliminate them.
Re:Attitudes That Lead to Maintainable Code
by blowski on Wednesday March 08, 2017 @11:45AM
(#13821415)
I'm guessing you know it, but for those that don't, The Phoenix Project is also an excellent book for understanding the similarities between manufacturing and software development.
Re:Attitudes That Lead to Maintainable Code
by jrs235 on Wednesday March 08, 2017 @12:16PM
(#13821656)
I did not know that. Adding that to my reading list. Thanks!
Re:Attitudes That Lead to Maintainable Code
by clay_to_n on Wednesday March 08, 2017 @01:06PM
(#13822157)
I loved discovering the main bus strategy in factorio (everything you produce goes on a very wide main bus, so that others can easily pick it off) at the same time I was implementing an Event Bus (post events to one bus, subscribers listen and react) in some Java code. Perfect parallel, even called the same thing.
If you never "refactor" your factories in Factorio, you'll end up with an undefendable and inefficient mess. Spaghetti factories indeed. But if you stop to think, spend some time refactoring how things are working, and build to your new technologies, you'll end up with a megafactory which can help you escape with no problem.
It also highlights the importance of experience and experimentation; finding the proper ratios of furnaces to miners, maximizing the bandwidth of a conveyer belt while minimizing the stagnant materials; once you learn this, your next playthrough will be both faster and require less refactoring.
As for SOA, one thing Factorio taught me was the value of back pressure. Why spend resources producing materials which aren't being consumed? Conveyer belts and movers show the value of backpressure nicely - when the belt is full, movers stop placing items on the belt. The factories stop producing, and thus stop consuming intermediate materials... all the way back to your miners. But the moment that belt starts to clear up, the entire mechanism swings back into work, with enough queued materials to ensure that you are not suddenly starved.
The parallels with programming are a bit more indirect than with actual material production, but they do exist.