Do you try to memorize the algorithm?For...?
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
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
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:
Originally Posted by lucky_luke
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.
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.
Originally Posted by viaxd