
Ask HN: Using Factorio as visual programming, refactoring, and design tool - backslash_16
Hi,<p>I&#x27;m playing around with the idea of having developers I work with play Factorio for a little while as a good intro to design, implementing, and refactoring.<p>The idea that Factorio is visual programming keeps growing on me, and that the visual and game play feedback provided by a spaghetti base design that only you really understand and can extend is very similar to programmers reactions to legacy code in the workplace.<p>Needing to rip up your base and then re-lay it down as you learn more about the game play mechanics (aka become a better programmer) feels similar to refactoring for me. There is a sense of well it works now, why not just add on another wing instead of doing &quot;it right&quot;.<p>Building small components that you can link into each other and reuse is almost the core mechanic of the game, and is also a core tenant of building reusable software.<p>Lastly, and I might be stretching here, the visual environment can be likened to TDD or at the very least a short feedback loop. When you take an action you have to deal with the consequences, and reap the benefits immediately which if you squint is like writing tests to exercise your API&#x2F;objects as you write them, making sure that when you change your API&#x2F;objects&#x2F;whatever you feel the change as quickly as possible.<p>Is there any validity to this? Am I going to ruin their productive lives by introducing them to Factorio?
======
rowleyaj
> Am I going to ruin their productive lives by introducing them to Factorio?

Yes most definitely, but they will enjoy it!

That said, I do agree that you can look at designing a factory with a mindset
of writing good code, and refactoring that code as you modify the factory. I'm
not sure if this will provide a benefit to existing programmers, I could see
it being useful for explaining those concepts to new programmers - perhaps as
part of an IT class in school though.

~~~
backslash_16
That's something I'm wondering about too.

In a professional setting is the time better spent practicing refactoring
katas and going actual development techniques to make code better vs playing a
game.

I think using it in a CS101 or learn to program class would work well.

