how to overcome this difficutly - Unix

This is a discussion on how to overcome this difficutly - Unix ; Hi, All: Maybe this is a little off-the-topic. but I really need some help about this! I am just starting programming in linux, I read and write some Programs in linux: I found it is easy with little programs, but ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: how to overcome this difficutly

  1. how to overcome this difficutly

    Hi, All:
    Maybe this is a little off-the-topic. but I really need some help
    about this!
    I am just starting programming in linux, I read and write some
    Programs in linux: I found it is easy with little programs, but when I
    cope with some lager program I found it is difficult for me to
    understand the source code.
    My point is: how can I overcome this kind of difficulty, how can I
    understand the source code? When you started to program in linux, what
    books you prefer? do you have any recomendations?
    thank a lot?


  2. Re: how to overcome this difficutly

    hai.xu1@siemens.com wrote:
    [followups set to comp.programming]

    > Hi, All:
    > Maybe this is a little off-the-topic. but I really need some help
    > about this!
    > I am just starting programming in linux, I read and write some
    > Programs in linux: I found it is easy with little programs, but when I
    > cope with some lager program I found it is difficult for me to
    > understand the source code.
    > My point is: how can I overcome this kind of difficulty, how can I
    > understand the source code? When you started to program in linux, what
    > books you prefer? do you have any recomendations?
    > thank a lot?


    One mistake is to try to learn programming from looking at the source of
    publicly available programs. For various reasons the code for these
    programs are _not_ written with "beginner comprehendability" in mind.
    It's better to follow a good book on whatever language you've chosen
    and look at sources only after you've gained some practice and working
    knowledge of the language.

    For tackling complexity each language has it's own paradigm[s] and
    tools. Structured and object oriented programming are two such methods.
    In general, complex tasks are broken down into a set of simpler steps,
    regardless of how exactly these steps are represented, i.e., either as
    functions or objects or whatever.

    For understanding large programs first read it's documentation,
    including developer specific ones, if any. Then try to get an overall
    picture of the program's interfaces, either public or private. For C
    like languages this is usually in the form of header files. Then try
    your best to start at the program entry point, (i.e. main() for C
    etc.), and trace the flow of execution. This may be impractical for
    programs above a certain level of size and/or complexity.


  3. Re: how to overcome this difficutly

    On Oct 31, 7:32 pm, hai....@siemens.com wrote:
    > Hi, All:
    > Maybe this is a little off-the-topic. but I really need some help
    > about this!
    > I am just starting programming in linux, I read and write some
    > Programs in linux: I found it is easy with little programs, but when I
    > cope with some lager program I found it is difficult for me to
    > understand the source code.
    > My point is: how can I overcome this kind of difficulty, how can I
    > understand the source code? When you started to program in linux, what
    > books you prefer? do you have any recomendations?
    > thank a lot?


    The worst way to try to understand a program is to look at its code.
    Imagine if you had never seen a car before. Trying to take apart a car
    would be a very lousy way to try to understand it. What you would
    first want is a high-level understanding of what the major parts are,
    how they connect to each other, and what each one does. Only then
    would you move on to looking at individual parts.

    Most large projects are like most modern cars. They're very complex
    and difficult to understand. They have to deal with a lot of bizarre
    real-world ugliness. You're better off starting with programs that are
    specifically intended to be understandable (even if they are useless).

    DS


+ Reply to Thread