The Siren Song of Complexity and Deflating the Ego
Week one. Day five.
Today was project day. In the morning we set out to implement a basic Sudoku solver. Three of us, including me, had already implemented the program. And so while everyone else was sent off to write their own solver, the three of us were given a chance to write a solver which could handle fiendishly hard puzzles, i.e., puzzles which cannot be solved without testing guesses.
Even though I wrote the basic solver just a week ago, I labored all day with my pair to get the basic implementation working. This time, though, we tried to be more sophisticated about it. Instead of a single solver class, we thought, let’s have several classes: a solver, a puzzle, a container (for rows, columns, and grids), and a cell class. The result? After eight hours, we still didn’t even have a basic solver working. It was ten hours chipping away at a problem that refused to crack open.
It was a hard day.
Now that I’ve eaten something and had a couple of hours away from the computer, I think the take-away here is that complexity is seductive. It promises convenience and so the new developer naively pursues it, envisioning great gains while underestimating the cost. In the process, though, the cost of that complexity often overtakes any potential gains. It was the complexity of our approach which defeated us. And so, simplicity — or minimal complexity — wins. Especially when it’s a tired developer working under sub-optimal conditions (long hours, day after day, with little rest or time away).
The other big discovery today was my reaction to the whole experience. I detest the feeling when a problem defeats me. The surprise, though, was that I don’t feel discouraged or stupid. In other words, my ego is not tied to my success or failure in coding a problem. I have somehow separated my own self worth from the quality of my code. Naturally, I prefer solving problems with beautiful code. But failing at the problem today does not change my love of working with computer languages to solve such problems. In fact, instead of throwing my hands up in disgust, I’m already planning a second attack.
I take that to mean I’m in the right place doing the right thing.
Tomorrow is the weekend. We’ll have an assessment to complete which measures our grasp of this week’s material. Expect to spend two hours to all weekend, they said.