??? 06/16/09 12:28 Read: times |
#166136 - Generic solutions applicable to more people Responding to: ???'s previous message |
As a general concept, reading code is a very good way of learning. But this form of learning does not require the code to correspond to any real problem at hand. It is just a question of reading code - any code - of a suitable complexity. Good code shows techniques to use. Bad code shows what to avoid. With more experience, the size of the projects or the complexity can be increased.
When I started to program, I harvested a lot of ftp sites. I downloaded whatever code I could lay my hands on and read it and tried to understand what the code did, and tried to figure out what reason the developer could have had for doing it that way and if I could possibly see any alternative ways of doing the same thing. This was not: "I need code for a multiplexed display". This was: Anyone know of an ftp site with lots of source code? Then I took it from there. It was a way of collecting the basic building blocks. I could then correlate what I picked up from the source code with computer algorithms books I bought or read at the library. In the end, I felt that this was a good way of very quickly gain the knowledge to write my own programs from scratch. After all, the end goal was not to be able to adjust someone elses code, but to learn to write at least as good code myself, on my own. But this approach only works if the focus - at all times - is to understand exactly what makes the code tick. Sometimes down to the last variable. Sometimes just quickly browsing through a large code mass and ignore the regular stuff while trying to see if the code has any advanced secrets to focus on. "Give me code" is a request by someone who don't care about how the code works, and who have no interest in being able to adopt the code. Both a professional or a caring student would instead focus on their current knowledge level, and how they can extend that knowledge or how they can improve on an existing solution. If someone asks about a concept, I can spend 5 minutes giving a pseudo-code answer. Or I can spend 60 minutes giving a "real code" answer. The question is: Why should I spend the extra 55 minutes? These 55 minutes could be used either to write code for myself, or for giving several more answers. After all, the total amount of time available for giving people help is limited. People are also more willing to help people who are willing to spend time helping themselves. And if posting code, more people have use of generic solutions than specific solutions only applicable to the OP. |