The Shape Of Your Code25 Sep 2018
Before continuing any farther, first stop. Open up a file containing code that was written in the last week. Next, do the same thing with a piece of code that was written 2 years ago.
How do these two files look different? Ideally these would be two files in similar directories. A good choice here would be a spec/test or controller, if MVC is still a way to structure code. Maybe an easier way to see the differences inherit in these two files is using some piece of version control software (also if still en vogue). Where are the additions and deletions? How much red (deletions) and green is visible? How does the shape of the code differ from one another?
Since parsing through time is much easier with computers connected to infinitely sized cloud storage; this exercise should be an absolute breeze. Coupled with tools like TimeMachine, the ability to laser focus on a specific time in the past is easier than ever. If you build prose or code this is a blessing and, more than likely a curse.
The purpose of the above is to gauge overall change across the time difference. If the chasm is only two to three months, the diff might not be so stark. However, if the span of time between both files is any more than a year and they aren’t visibly different… Houston, we have a problem.
Code or prose produced today, shouldn’t look like anything produced yesterday. Yes, there should be consistency and cohesiveness. However, how can anyone measure growth if nothing changes? Code’s shape is highly influenced by the ecosystem it lives in. Who’s adding to it, removing from it, and etc. Churn, in a space where all participants are learning at a rapid pace, is impressive. Techniques are brought in, shared and spun out depending on their viability and resilience. Everyone participating is learning at a rapid pace. Their code is shifting, growing, and stretching boundaries.
The opposite of this, as slightly foreshadowed above, is a desert without wind. A sea of sand solidified in place, not by extreme heat but, the lack of any real catalyst. Take a good inward look and decide on what is more important:
- A space devoid of creativity, risk, and change. However, filled with security.
- Or a codebase that’s in rapid flux. A space where people are free to explore and are empowered to try?
There’s of course no right answer to the above. Some of us gravitate one way or the other. Although a career can be shaped by rigidity and a conservative point of view, it’s something that’s not on my plate. Carol Dweck in her book Mindset wraps this up in such a wonderfully small package
Becoming is better than being