need suggestions on how to read other people code.
-
help.. because it can be the most boring thing to do. i really don't know anything to help it other than my curiosity. yes curiosity helps but i need to - grasp what the code does.. fast! - without breaking my head. (is this a joke? i'm asking myself) - get it done only with a cup of coffee.. lol (joke? yes/no? hmm)
-
help.. because it can be the most boring thing to do. i really don't know anything to help it other than my curiosity. yes curiosity helps but i need to - grasp what the code does.. fast! - without breaking my head. (is this a joke? i'm asking myself) - get it done only with a cup of coffee.. lol (joke? yes/no? hmm)
-
JoeMan wrote:
grasp what the code does
Read it and re-read it. Compile it and step through it with the debugger to see how things work. There is only one way to make progress: practice, practice, practice.
MVP 2010 - are they mad?
debugger... never thought of it thanks a lot
-
debugger... never thought of it thanks a lot
-
help.. because it can be the most boring thing to do. i really don't know anything to help it other than my curiosity. yes curiosity helps but i need to - grasp what the code does.. fast! - without breaking my head. (is this a joke? i'm asking myself) - get it done only with a cup of coffee.. lol (joke? yes/no? hmm)
If I've got a piece of 'foreign' code I really have to understand, I usually make a copy of it and refactor it to my coding style and naming conventions. Doing this carefully, and stepping through the result in the debugger, usually gives me enough understanding to either use the code or rewrite it.
Software Zen:
delete this;
Fold With Us![^] -
help.. because it can be the most boring thing to do. i really don't know anything to help it other than my curiosity. yes curiosity helps but i need to - grasp what the code does.. fast! - without breaking my head. (is this a joke? i'm asking myself) - get it done only with a cup of coffee.. lol (joke? yes/no? hmm)
A good first step that's worked for me is to comment the code. First a header for each method that explains what the method does. Next comments on the variables of the class, explaining what they do and how they're used. It also helps to comment unclear blocks of code once you figure out what they do, so you don't have to solve the same problem again later.