2 ms·
READ -> WRITE -> REPEAT Reading code is quite different from reading text be it fiction, non-fiction, poetry or prose. One striking difference is code is not
by sh87 10y ago
READ -> WRITE -> REPEAT
Reading code is quite different from reading text be it fiction, non-fiction, poetry or prose. One striking difference is code is not optimized for (human) reading whereas books are (at least the good ones). So trying to make meaning of code requires a true companion to reading (and comprehension) - imagination. I found it immensely changes the speed at which I could absorb content when I could build a mental roadmap and try fit things in. So if I was reading code that dealt with a new domain like MRI/PET scan imaging software, I started with domain knowledge first and then followed the code to draw parallels. That helped me build a mental model of how the code modelled the problem domain(e.g. window width/level, reconstruction) to familiar software domain (pixel values, approximations). Now once I had these 2 mental models and how they are connected. I would try and implement them in small independent ways and then combine them (the unix way if you will). Once I had a decent grasp on these two models (i.e. I could explain the domain concept to at least 2 people - one who knows it already and one who does not and visualizing the program execution in my mind) I then slowly added more details to my mental model.
This however, was different than the first step. Now when I read more concepts, I first try to fit it in the mental model that I have, imagine how I would implement it and then actually see an implementation of how it was done by someone else. Usually I come up with better solutions but thats because I am ignoring some constraints that the developer(s) had.
So after a few iterations, you'll subconsciously built great organized mass of knowledge that you can add to or draw from. This one slow, hard exercise had improved me as a developer more than learning any new framework or language. These days I am not the first to jump on to the next shiny thing but once I do decide to my progress is way faster than what I had before and as compared to others giving them the impression that I am a fast learner (which surely I am not).
So a satrical way of stating this is to be a better developer, just write more code, which although partly true does not make sense unless you realize that your primary asset is the mental models you have built over many many hours and years.
What i struggle with most is to keep up with the rate of new information available and the consequent higher demands of filtering it out and the physical limitation of my memory (I cant remember every detail of everything I have learnt) and these models are complex enough that I must spend time to write notes in a way that they are optimized for fast reading without losing too much detail.
So yeah, off topic but that one thing sure did make me a better developer (in my opinion).