Its Already Hard, Don't Make It Worse.
I was ice climbing with a buddy once in the Adirondacks We had hiked up to the bottom of Multiplication Gully, which is a very popular climb. It was 25 degrees out, but it’s a steep approach and we were carrying heavy packs so we hiked up in long sleeve t-shirts but were still sweating.
When we got there, there was another party ahead of us. The climb is a big funnel and ice climbers tend to knock down a lot of ice. If we didn’t want to get pummelled by falling ice, we would have to wait. We picked a nice spot to wait off to the side under a little overhang that would protect us from falling ice.
Even though I was sweating I immediately put on my belay jacket. My partner did not. I said something to him, but he brushed me off with some form of “I’m tough, I’ll be fine.” I gave him a quizzical look but didn’t give it much more thought.
We waited for 45 minutes before I headed up. Another 45 minutes and I was at the top of the pitch belaying him up. He seemed to take forever. When he got up there he was still in his t-shirt, purple and shivering. I gave him my belay jacket and he seemed to perk up. We did manage to finish the climb. It was only one more pitch. If it had been any longer, we probably would have bailed.
Afterward, I remember saying to him, “If you do enough mountaineering, you don’t have to go out of your way to try to be tough, the opportunities will find you on their own.” If you spend enough time in the mountains, you are going to get benighted or caught in a storm or lost. It’s inevitable. It’s hard enough. There is no need to make it artificially hard.
Coding is already hard
The same concept applies to coding. You don’t need to add any unnecessary complexity, it will find you regardless. It’s always easy to add more complexity, but it is difficult to remove it once it is there.
At GDevCon N.A., Norm had an interesting quote that I hadn’t heard before:
One man’s abstraction in another man’s obstruction.
The biggest way I see people adding unnecessary complexity to software is through too many layers of abstraction. Yes, abstraction is a good thing. It gives us flexibility. However, too much of it makes it incredibly hard to figure out what is actually going on. Adding unnecessary abstractions is making coding harder than it has to be. Don’t do that. Keep it simple. Start with the simplest thing that could possibly work and only add abstractions when you absolutely have to.
Another example I see often is too many parallel processes. Some developers think everything should be an actor or a DQMH module. I’ve seen DQMH modules where every message was a synchronous Request and Wait For Reply. At that point, you might as well just have a synchronous process. You lose all the advantages of having a DQMH module. The module itself becomes a distraction. A simple class or library would work much better in that situation.
If you’d like help removing the unnecessary complexity from your code, let’s talk.