Complexity

Developing the skill to know when to reach for complexity is hard
Published on 2024/04/10

In the last few months, we had a lot of conversations on my team about the present and the future. To know where you want to go you need to know where you're at. Mine and some adjacent teams grouped together to review our architecture. At a glance, there are not that many moving parts. Some complexity is hidden but the high-level ideas are fairly simple. This made me think about complexity in general.

I remember when I was looking for my first job, I would grind leet code problems to get that muscle memory developed. I would feel smart coming up with some clever solutions, or even hacks, that would make my approach succinct. It didn't take me long after my first job to realize how silly I was. Some nifty language features are good to keep in your pocket but seldom should you reach out to use them. It's not a mystery that we spend way more time reading than writing code. This should convince you that you should write clear and simple code for humans and avoid anything that requires mental effort to be unpacked. The fine art here is to understand WHEN to reach into that pocket.

Complexity can surface anywhere, from writing to design, from system architecture to algorithms. Breaking down anything seemingly complex is a tough skill to develop and one I continuously pursue. I try to make my code obvious and my writing simple. Whenever the complexity cannot be unpacked, I try my best to help others create a mental model. Without getting into too much detail, part of what I work on at MongoDB is our cloud functions engine. This was mostly built before I joined and it glues together many components, this inherently makes it easier to get lost. Since day 1 I tried to document it, break it down, clean it up, and eventually present how all the pieces come together.

If you pause for a second, try to fish out of your memory anything complex you had to deal with. If it's a book I bet you're forced to slow down when reading and often re-read. If it's a piece of code, it's possibly hard to debug and follow the logic. If it's an entire architecture, good luck tracking down which part stopped functioning correctly. The trend is clear, the more complexity you add to any system the harder it is to maintain, share, and recollect.

Thoughts

Complexity is an easy way to push people away, including yourself. Learning when it's the right time to reach for complex approaches is an art. Equally important is knowing which level of complexity is appropriate for which audience, as its perception can vary greatly. There are many examples around you, I recall learning Linear Algebra in college as a first hard topic in year 1. Almost a decade later I picked up "No Bullshit Guide to Linear Algebra" (highly recommended) and every page I turned was an epiphany. I realized how even something that can get as complex as Linear Algebra can be explained in a much simpler manner. I kept thinking "Why did no one tell me this?", "Why was this trivial example not in every book or class?". I was surprised at how many things clicked just by casually reading through it. Keeping things simple is hard, but that doesn't mean you shouldn't try.

0
← Go Back