Skip to main content

The Pyramid

In psychology, there is a concept called Maslow’s Hierarchy of Needs. The idea is that humans have needs, and they can be organized in ordered groups, such that the person experiences few of the needs of group N until needs of group N-1 are satisfied. They are most frequently visualized as a pyramid

Maslow’s Hierarchy of Needs visualized as a pyramid

While this layout makes it easy to understand and explain to people, this sort of visualization is probably closer to the average case:

Alternative visualization

For example, a person is unlikely to feel the need to think lofty philosophical thoughts when they have to worry about personal safety, or are barely making ends meet.

I find that things exhibit a similar property. In first year of university, “my code compiles” was a thing, to a surprising degree. This property of code says very little about how it satisfies various real-world requirements, not least of them “program actually works”, but it is a basic need. Students forced to take computer science classes as part of their otherwise unrelated math major would often stop once this need is satisfied. Next up is probably something like “my program doesn’t crash”, then “produces some output”, and finally “the output is correct in the general case”. Following that would be “the output is correct in all the edge cases”, and then last, depending on the university, I suppose, is “there is reasonable documentation”, because documentation is apparently desirable[1].

The needs described above are like level 1 of Maslow’s hierarchy. On levels further up, you start getting things like “code is readable to me now”, and later “code is readable to me in the future, when I’m out of context”. There’s also “code is testable”, “code is reusable”, “code is performant”, “thread-safe”, “behaves expectedly”, “is easy to follow”, “has low incidental complexity”, and a myriad more things, each on some level of the pyramid. Generally you can focus meaningfully on each of these things only if you’ve cleared the levels below them.

An important point about the acquisition of things is that your focus is limited, which means you can actively learn and practice only a small number of new things at any one time. The key is to pick suitable things to work on for your current level, work on them as efficiently as possible, push them down into the subconscious, and then move on to new, higher level things.

Next: Communication ⇒

[1] I think documentation, written as comments, is rather evil. See no comments

Comments