Thread: Do you try to memorize the algorithm?For...?

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    2

    Do you try to memorize the algorithm?For...?

    hi
    This thread may seem silly to some,but this problem is really getting on my nervs

    When you read source code for whatever kind of program,do you try to memorize the algorithm?How long does it stay in your memory?
    For example,when I read TFTP source code on linux,I tried to remember the program's algorithm(by memorizing I don't mean the names of variables and function, but instead what function calls what function,where in program is function called and what for)
    Anyway,I noticed that in week or two after remembering the algorithm,I almost completely forgot.

    This wouldn't be such a problem if not for the fact that programming is all about algorithms.

    Do you try to memorize algorithms or do you keep them in memory only for the time you need them,and if later need for particular algorithm arises,you learn it all over again?

    any and all help will be appreciated

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    i think your perception of an algorithm is off a little. what you memorized was not an algorithm, it was an implementation of an algorithm. memorizing algorithms can be very handy but memorizing implementations is way too much info, you should be able to generate the implementation by knowing the algorithm. Algorithms are the conceptual backing of the solution, the idea, or high level proceedure.

    so, for me, in short:
    memorize algorithms that are of use to you: yes
    memorize particular implementations of them: no

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    2
    I sort of understand what you mean.

    But can you give me an example(TFTP would be best,in case it's one of the algorithms you know),so I get the feeling of how "high level" the thing should be?It would really help a lot

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by lucky_luke
    I sort of understand what you mean.

    But can you give me an example(TFTP would be best,in case it's one of the algorithms you know),so I get the feeling of how "high level" the thing should be?It would really help a lot
    ok, so im assuming TFTP is an FTP client of some sort. In this case, TFTP is an implementation of a client which uses the FTP protocol. A protocol is sort of like an algorithm except its not really functional, its more of a set of rules for communication. If you want to try writing an FTP client, becoming familiar with the protocol (or memorizing if you prefer) would be a good start. An algorithm for a simple FTP client would be something like this:

    1. get input from user
    2. validate input (is it a valid command?)
    3. send command to server
    4. recieve response from server
    5. rinse and repeat (either jump back to 1 or 3, depending on the response from server)

    this is basic but it should give you a good idea of what i mean by high level. If your still curious about the differences between algorithms and implementations, look up some sorting algorithms. Sorting algo's are the classic learning example.

  5. #5
    ~viaxd() viaxd's Avatar
    Join Date
    Aug 2003
    Posts
    246
    umm, Perspective, TFTP isn't really a FTP client, TFTP stands for Trivial File Transfer Protocol, it's different from FTP, but i believe there is a client called tftp as well. This of course makes little difference in this thread.
    :wq

  6. #6
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Quote Originally Posted by viaxd
    umm, Perspective, TFTP isn't really a FTP client, TFTP stands for Trivial File Transfer Protocol, it's different from FTP, but i believe there is a client called tftp as well. This of course makes little difference in this thread.
    oh, heh. i guess i should have checked it out before my rant, but like you said, the principle is still the same.

Popular pages Recent additions subscribe to a feed