3 ms·
Writing understandable code is a difficult problem. There is no simple trick that will make you just do it over night. > Code is (almost?) always obvious to yo
by BurningFrog 8y ago
Writing understandable code is a difficult problem. There is no simple trick that will make you just do it over night.
> Code is (almost?) always obvious to you as you are writing it.
I try hard to go back and reread code as I'm working on it, several times a day, as if I'm someone else, seeing it for the first time. It may help to pretend I'm showing it to a particular coworker.
It's a certain kind of empathy skill that it takes work to develop, but it's very useful both for coding and any other writing.
Perhaps the most common problem is what I call "assumed context". That is, you're so deep into the task that you take the major parts of it for granted and it never occurs to you to explain the most basic and fundamental parts of what you're doing. Instead you explain minor details.