How I solve problems

I have an ongoing battle in many cases with my dev teams on how we should be solving problems. I have always had a philosophy that we need to do things in the simplest way possible. My analogy is typically "Don't make the code too smart, make it just smart enough to do what it needs to do". I think this philosophy applies to much more than coding, and can apply to many of the problems or challenges we all face professionally.

In the spirit of this, I will submit for your review, this simply amazing piece of writing. Yes, it is about game programming, and yes, I generally deal with the most boring, buttoned down business in the world. But this approach to architecture still speaks to my soul, and I can heartily recommend reading it for anyone. And by anyone, I don't just mean people who write code, develop software, or design solutions for big boring database stuff like I do. This really applies to any sort of problem solving.

Here is one of my favorite quotes from the introduction. I have spent so long explaining this in clunky inelegant ways, in the future I'm just stealing Robert Nystrom's work, but will be providing the reference to any fellow souls who also feel the level of kinship to Robert's philosophy as I do.

We’re rarely presented with an elegant problem. Instead, it’s a pile of use cases. You want the X to do Y when Z, but W when A, and so on. In other words, a long list of different example behaviors.
The solution that takes the least mental effort is to just code up those use cases one at a time. If you look at novice programmers, that’s what they often do: they churn out reams of conditional logic for each case that popped into their head.
But there’s nothing elegant in that, and code in that style tends to fall over when presented with input even slightly different than the examples the coder considered. When we think of elegant solutions, what we often have in mind is a general one: a small bit of logic that still correctly covers a large space of use cases.

Architecture, Performance, and Games · Introduction · Game Programming Patterns Here is a link to the online version of thisbook, it is the full version, and completely free.

To view or add a comment, sign in

Others also viewed

Explore content categories