Posts

Showing posts from May, 2024

Profitable Struggle and Unprofitable Struggle

Imagine I have to work in an unfamiliar and tough passage of code. Unprofitable Code I spend time and effort to puzzle it out, and all I get from it is that now I understand that tough passage. If it was written in the most primitive way possible, using no interesting language or library features (which might have made it less puzzling) then it is unprofitable .  I have invested my time in "playing computer," simulating every line of code and tracking each value in my head, or perhaps I walked through every line and watched every variable in a debugger.  I have expended this effort of will and focus but received little in return. I know what this bit of code is doing (for now) but I won't be any faster to write or read other code because of it. That knowledge will be lost in months, possibly weeks or days. The unprofitable code, left in its original form, will require as much effort next year as it did this time. It is a productivity speed bump. Profitable Code OTOH, if I...