What do programming, playing Starfield, an putting together jigsaw puzzles have in common?
Everything!
At least, if you look at them the right way.
Let’s start with the simplest: putting together a jigsaw puzzle. You start with a huge, jumbled mess, a rough idea of what it’ll look like at the end, and maybe a couple of strategies for getting from mess to solved puzzle.
I’ve just described programming! That is exactly what it’s like. You start with nearly infinite pieces and a vague specification of what you want to do, and hack your way from one side of the puzzle to the other.
There are lots of other parallels:
- Brute forcing: For simpler puzzles, it’s often easier to just ‘brute force’ your way to a solution. “Brute forcing” is trying every combination, one after another, until you find a solution. For a jigsaw puzzle, that might mean finding where a piece fits by trying it against every empty spot. If there are a lot of pieces or a lot of empty slots, this is practically impossible, but if you are down to only a few options, this may be the way to go. I do this in programming too: sometimes it isn’t obvious which approach is the fastest, for example, so you either have to do some analysis or just try all the approaches and pick the best one. Which technique works best depends on how many alternatives there are and how hard they are to implement.
- Divide-and-conquer: small problems are usually easier to solve than big ones, so when solving puzzles, it pays to divide the big problems into small ones. This approach is human kind’s single most power tool – the world is too complex for us to really understand, so engineers and scientists reduce it to easier chunks and understand those. For a jigsaw, that might mean finding the puzzle edges and fitting those together, or sorting pieces according to patterns. In coding, we always break big pieces of code into smaller modules that fit together.
- The closer you get to a solution the faster you go (less options, less searching): in jigsaws as in coding, options are your enemy. The beginning of any project involves lots of decisions and experiments. As you work your way through those, things get easier and easier, just as putting together a jigsaw puzzle accelerates as there are less and less pieces to fit. But, this is often an illusions, due to the…
- 80/20 rule: Roughly, the last 20% of your puzzle will take you 80% of your time. This is because we usually leave the hard stuff for last – who wants to deal with 300 random pieces of identical blue sky (or snow… don’t get me started). Likewise, in coding the last few bits are the hardest – you get to stage where you’re tying all those modules you divided back together, and discovered wierd scenarios you didn’t think of, and debugging your mistakes. It isn’t rare to spend 2-3 days tracking down a problem with a single line of code, but when you find that bug…. :chef’s kiss:
It turns out we humans think we’re smart, but what we really mean is that we have tools for reducing chaos into order.
And where does Starfield come in? I lovehated playing this game. I hated how boring and clunky it is. The story is crappy, if there is one. Doing things like making money is needlessly clunky. But, all that clunkiness is a puzzle in itself! See, what I love about it is that I’m struggling against the game engine to get it to do what I want. Anyone can press a button and shoot bad guys. Figuring out how the hell Starfield outposts work? That is puzzle-solving :)
(update: I wrote that bit about Starfield back when I was still playing the game… now that I’ve put it down in favor of actually good games, I realize I was suffering a sort of stockholm syndrome :))
Leave a Reply