58% Is Spent On Comprehension
According to this article, we spend most of our time in a codebase trying to understand it.
blog.feenk.com (Accessed Monday, February 1, 2021)
This paper is quite interesting in that it describes in great details how the figures are obtained. And it says that Comprehension took on average ~58%
It isn't the only evidence for so, see the following comment:
matklad.github.io (Accessed Sunday, February 7, 2021)
Roughly, it takes 2x more time to write a patch if you are unfamiliar with the project, but it takes 10x more time to figure out where you should change the code.
An Unsolved Problem?
Our IDEs are mostly text based with some autocomplete and jump to definitions, but it certainly feels that we could increase code comprehension if we explore giving more contextual guidance to the code.
There are some companies exploring how to increase code comprehension:
- SourceTrail https://www.sourcetrail.com
- Maybe MakePad? https://github.com/makepad/makepad
- Jupiter note book https://jupyter.org
- Sketch for ReasonML and OCaml https://sketch.sh
- Replay.io https://replay.io See it in action in this loom video https://www.loom.com/share/fd48dab3e0444686a74234364faf6645
I’m yet to see a universal IDE based on AST instead of text based. It might not be impossible to achieve specially with the standardization of the Language Server Protocol.
For me this impacts how I interview someone. I am more inclined now to also check how you can interpreted/parse code you have not written. In my personal experience this is for sure fundamental to a developer - the ability of reading code.
What Can We Do For Now?
You can write less, simpler, and explicit code. Specially since our tools for code comprehension have not significantly evolved since the creation of computer.
You can also read my take on Explicit vs Implicit here, it is directly related to this topic.