fun size

October 2017 ยท 1 minute read

I wince every time I encounter a class with a few hundred lines in it. It’s awkward and frustrating to have to repeatedly scroll up and down to gather enough context to understand an object or a function.

Simple Huge functions sweep shared state under the rug. They bury individual operations where they can’t be easily tested or understood. They create artificial boundaries that dull our ability to discover simple, composable abstractions.

make smaller things

We don’t structure software systems as single 100,000 line files; that would be absurd. Why do we tolerate 500 line units composing them? How do we convince ourselves that a 1000 line accompanying spec for each of these units is useful documentation?

Entropy increases. Scope creeps. Classes tend to grow responsibilities over time. These are weeds in our garden, and it’s up to us to pull them out.

We can always try to make things smaller.