Tyler Willingham

Code it like I'm 5.

I've worked on a lot of applications and seen how complexity manifests itself in many different ways. There are a slew of solutions to combat complexity that people infinitely smarter than I have figured out, named, written and given conference talks about.

Small objects and small methods are great. The smaller your chunks of code are, the more frequently you're given the opportunity to name concepts and provide breadcrumbs for the developers who will come behind you.

In the pursuit of simpler code I've heard the argument made that "senior developers should be able to reason about and interpret complex code quickly". While I do agree that a senior should be more skilled at this than a new developer, I think that misses the point.

All parts of your application should be accessible by all levels of developers within your organization. It's the responsibility of us, as experienced programmers to simplify the path forward and mark the trail with clear signage. This doesn't require dedicated time. This is our job. This is what we should be doing every single day.

Ignoring complex code and reserving it for your most senior developers is massively expensive. Not every developer is the same and it is unreasonable to think that all your engineers can hold the domain knowledge of a particular set of code in their head for weeks or months or sometimes years.

Reserving difficult to comprehend code for your most expensive resources is silly. It sets barriers within your organization where other people do not feel like they are inteilligent enough or trusted enough to work on those areas. And now you've said that the hardest things - which generally take the most time - now have to eat away at your most costly engineers.

My advice is to form the habit of writing code that requires as little friction as possible for your junior engineers to understand. If your juniors can ramp up easily, your intermediate and senior level developers certainly can too. Then you can stop worrying about comprehending code and get back to focusing on problems that actually matter to your customers.