3 ms·
I don't find reading well-written code any more difficult than reading a math book. But of course it is an order of magnitude harder than reading prose. You hav
by mark-t 18y ago
I don't find reading well-written code any more difficult than reading a math book. But of course it is an order of magnitude harder than reading prose. You have to force yourself to slow down and understand what each part is saying. As opposed to ordinary text, every word is important, and you need to know what it's doing there.
Some of this is just proficiency in the specific language, but it's more about the concepts and idioms of programming in general. I've fixed a bug in an open source python project, and I couldn't write a "Hello World" program in python without a reference.
But do note that "well-written" is mandatory. If the code isn't well-written, it will take you a lot longer to figure out. The code I wrote in high school was pretty bad.
Variables should be named to describe what they represent. You should have a reasonable number of comments, not too many or too few (ironically, this amount changes as you get better). Divide your code into manageable chunks and split them into subroutines. Within subroutines, separate the chunks with at least one blank line.