I am currently reading a code. It has many classes and I have no idea of the structure yet. I even have no idea of how it work inside.
Now my question is, what are your methods of learning the code compose of several classes as defined in the situation above?
Do you have a technique? tips? tricks?
5 replies to this topic
#1
Posted 27 January 2012 - 07:55 PM
|
|
|
#2
Posted 28 January 2012 - 06:49 PM
It varies widely. I've been learning one program that has a few hundred source files for about 5 years. I can find chunks of code fairly easily, now, and understand the major structure. A lot of it is just slowly getting the feel for the major structure, and slowly gleaning the details of various methods/variables as you explore it.
#3
Posted 28 January 2012 - 08:53 PM
WingedPanther said:
It varies widely. I've been learning one program that has a few hundred source files for about 5 years. I can find chunks of code fairly easily, now, and understand the major structure. A lot of it is just slowly getting the feel for the major structure, and slowly gleaning the details of various methods/variables as you explore it.
How did you do it?
#4
Posted 28 January 2012 - 09:51 PM
I started with a more limited area of functionality. While working with it, I'd run into a function in another file/code area. Sometimes I'd have to do a code search (jEdit makes it pretty easy) to locate the function in question. Once I understood that, I'd return to the area in question and plow on. During that time, I did a couple fixes to a rounding function that's used by 90% of the software in question, added new functionality, fixed a bug in about 3 spots in a 3000 line function, etc. The fact that Delphi makes it easy to connect form elements with functionality helps a lot, too :)
I've also had to learn several other languages, translate logic into those languages, etc. You work it 40 hours a week, for 5 years, and stuff gets absorbed. Just try to understand what you're dealing with now, and you'll start assembling things together as you work on it.
I've also had to learn several other languages, translate logic into those languages, etc. You work it 40 hours a week, for 5 years, and stuff gets absorbed. Just try to understand what you're dealing with now, and you'll start assembling things together as you work on it.
#5
Posted 29 January 2012 - 02:10 AM
WingedPanther said:
I started with a more limited area of functionality. While working with it, I'd run into a function in another file/code area. Sometimes I'd have to do a code search (jEdit makes it pretty easy) to locate the function in question. Once I understood that, I'd return to the area in question and plow on. During that time, I did a couple fixes to a rounding function that's used by 90% of the software in question, added new functionality, fixed a bug in about 3 spots in a 3000 line function, etc. The fact that Delphi makes it easy to connect form elements with functionality helps a lot, too :)
I've also had to learn several other languages, translate logic into those languages, etc. You work it 40 hours a week, for 5 years, and stuff gets absorbed. Just try to understand what you're dealing with now, and you'll start assembling things together as you work on it.
I've also had to learn several other languages, translate logic into those languages, etc. You work it 40 hours a week, for 5 years, and stuff gets absorbed. Just try to understand what you're dealing with now, and you'll start assembling things together as you work on it.
Thanks for sharing.
Uhm...do you try to draw it out? or create your own flow chart of the code as you try to trace it?
#6
Posted 29 January 2012 - 01:31 PM
There have been a few tricky bits of logic that I flow-charted out, but I mainly used an editor with great search and code-folding capabilities, along with the default editor for additional features. jEdit is still my favorite editor for it's powerful search capabilities.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









