Thread: The chicken and the egg problem... trying to learn coding but having trouble starting

  1. #1
    Registered User mothergoose729's Avatar
    Join Date
    Mar 2009
    Posts
    6

    The chicken and the egg problem... trying to learn coding but having trouble starting

    I have a good understanding of how to use windows, a basic understanding of linux, and I would say a very good knowledge base about computer hardware. I have read about 100 pages from a text I bought entitled "modern operating system concepts 7th Edition" and I am making good progress. My plan was to read this text from cover to cover, take a whole lot of notes and review myself a lot, figuring that would be an excellent base along with my current knowledge to tackle coding. The only problem is the text is starting to use a fair amount of coding as examples to the concepts. Thus the chicken and the egg paradox...

    I am still able to grasp the concepts of what the text is talking about, and I am picking up a few coding tid bits here and there. However, for the most part I do not understand what the coding means in these instances, and they brief descriptions are really not enough to fill me in. The below in quotes would be an example:

    Code:
    #include <sys/types.h>
    #include <stdio.h>
    #include <unistd.h>
    int main()
    {
    pid-t pid;
    /* fork a child process */
    pid = fork();
    if (pid < 0) {/* error occurred */
    fprintf(stderr, "Fork Failed");
    exit (-1) ;
    }
    else if (pid == 0} {/* child process */
    execlpf"/bin/Is","Is",NULL);
    }
    else {/* parent process */
    /* parent will wait for the child to complete */
    wait(NULL);
    printf("Child Complete");
    exit (0) ;
    which is a unique integer. A new process is created by the forkO system
    call. The new process consists of a copy of the address space of the original
    process. This mechanism allows the parent process to communicate easily with
    its child process. Both processes (the parent and the child) continue execution
    at the instruction after the f ork(), with one difference: The return code for
    the forkO is zero for the new (child) process, whereas the (nonzero) process
    identifier of the child is returned to the parent.
    Typically, the execO system call is used after a forkO system call by
    one of the two processes to replace the process's memory space with a new
    program. The exec () system call loads a binary file into memory (destroying
    the memory image of the program containing the execO system call) and
    starts its execution. In this manner, the two processes are able to communicate
    and then go their separate ways. The parent can then create more children; or,
    if it has nothing else to do while the child runs, it can issue a wait () system
    call to move itself off the ready queue until the termination of the child.
    Not adequate enough to really explain how this is working for me. I can't really come to these forums and tell somebody to teach me every time this happens either. I can still get the idea though. So I guess my question is, should I start learning basic code and then go on to finish reading this text, or should I just not worry about the code for now, learn the concepts, then figure out the specifics later?

  2. #2
    Resu Deretsiger Nightowl's Avatar
    Join Date
    Nov 2008
    Location
    /dev/null
    Posts
    186
    I would highly recommend learning C *before* digging into how UNIX and operating systems work.

    You end up learning how Linux works when you start digging into sockets and such in C anyhow.
    Do as I say, not as I do . . .

    Experimentation is the essence of programming. Just remember to make a backup first.

    "I'm a firm believer that <SomeGod> gave us two ears and one mouth for a reason - we are supposed to listen, twice as much as we talk." - LEAF

    Questions posted by these guidelines are more likely to be answered.

    Debian GNU/Linux user, with the awesome window manager, the git version control system, and the cmake buildsystem generator.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The only problem is the text is starting to use a fair amount of coding as examples to the concepts. Thus the chicken and the egg paradox...
    Your text is about operating systems, not programming. I see no chicken-egg problem.

    (The problem is misnamed anyway. For any given genetic variation, the egg comes first.)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    and the hat of copycat stevesmithx's Avatar
    Join Date
    Sep 2007
    Posts
    587
    I see no chicken-egg problem
    But I do see a mother goose.
    Not everything that can be counted counts, and not everything that counts can be counted
    - Albert Einstein.


    No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
    - Herbert Mayer

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    A what?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by CornedBee View Post
    A what?
    Do you steal quotes from other thread?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  7. #7
    Registered User mothergoose729's Avatar
    Join Date
    Mar 2009
    Posts
    6
    Ok, so I guess a new plan. Would becoming familair with DOS and Unix commands first, followed by learning basic coding be a good idea? I know very little about coding but I figured it was a good idea to understand what I was telling the OS to do before I started playing around too much.

  8. #8
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by mothergoose729 View Post
    Ok, so I guess a new plan. Would becoming familair with DOS and Unix commands first, followed by learning basic coding be a good idea? I know very little about coding but I figured it was a good idea to understand what I was telling the OS to do before I started playing around too much.
    A good idea would be to get yourself extremely familiarized with the C programming language as well as general programming concepts before you consider delving into operating system architecture and design. What you're doing is kind of like trying to read War and Peace in a language you can't comprehend. Sure, you could sit there and look up every word in a translation dictionary... but by the time you've translated everything, your result will just a bunch of mangled sentences and you'll have forgot what the story was all about in the first place. Take a step back from the book and try to prioritize what you really need to learn in order to achieve your goal.
    Sent from my iPad®

  9. #9
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by CornedBee View Post
    Your text is about operating systems, not programming. I see no chicken-egg problem.

    (The problem is misnamed anyway. For any given genetic variation, the egg comes first.)
    Not necessarily, the mutation might have begun as a tumor in the testicles of the proto-rooster, which means it started as a chicken part inside a whatever came before the chicken.

    Besides, the chicken always cum's before the egg <duck>


    Anyway, to the OP, you need to learn to flail your arms and legs before you start auditioning for a role in a broadway production of a Petipa-Tchaikovsky classic. I suggest a beginners level book on C/C++ programming. These generally assume that you know absolutely jack squat about programming, but know how to turn a computer on.
    Last edited by abachler; 03-20-2009 at 03:19 PM.

  10. #10
    Registered User mothergoose729's Avatar
    Join Date
    Mar 2009
    Posts
    6
    Lol, ok guys. I think I will start there. Thanks for the input.

Popular pages Recent additions subscribe to a feed