Jay Cruz

Problem Solving Isn't a Skill

The idea that "programming is just about solving problems" has always bothered me. It's usually the answer that's given when experienced Software Engineers are asked for career advice. It's a typical answer to the question "How do I get better at programming?"

It seems like a reasonable and valid answer. The code that you write to make something happen is a solution to a problem, generally speaking. Code is a recipe that makes a cake. Code can literally solve a puzzle and can literally solve for x.

But many people seem to repeat that programming is just solving problems as a copout and a way to be vague. It's a hand wave to avoid getting specific.

It wasn't until I stumbled upon this Scott H Young post on Cognitive Load that it became clear why the idea that problem solving as the underlying meta-skill to programming, while understandable, has always been suspect to me.

Problem solving isn’t a skill. The way we get good at solving problems is by having (a) knowledge that assists in solving the problem and (b) automatic procedural components that help in solving problems. There are probably no general problem solving methods that work for every domain. Heuristics for problem solving within a domain might exist. Still, the significance of these is overwhelmed by the power of having tons of learned patterns in memory. This explains why transfer is elusive and why expertise tends to be specific.

In other words, to solve a programming challenge you need to have the specific programming knowledge to solve it. Sure, Sherlock Holmes, with his power of deduction and logical reasoning, could maybe come up with something close to pseudo-code to solve FizzBuzz, but if he doesn’t know how to write in a programming language he wouldn’t be able to solve it. He would need to know the differences between even and odd numbers (I'm sure he does), and the specific syntax of a computer programming language, like if statements and what the modulo % operator does.

(Side note: I also have some issues with the idea that you don't need to be good at math to be good at programming, but that's another blog post.)

The problem I see with equating programming as problem solving is that it's one of those nice to hear ideas. Because everyone is good at solving problems. At least some types of problems. Some people are good at crossword puzzles, some at Sudoku, some at Chess, some at fixing cars, and some at making coffee. But these skills aren't necessarily transferable to programming.

The skill isn't the problem solving, the skill is being good at Chess or being good at fixing cars.

You might be really good at Soduku, but you're probably not going to figure out how to construct an undirected graph with just sheer problem solving will.

No matter how many general problem solving methods you might think you have, general problem solving is not really a skill. What matters most when it comes to programming is the specific knowledge needed to solve a programming task. As Scott H Young mentioned, you can't really practice problem solving. You can only practice and study specific things about the domain you're learning.