Many good, knowledgeable programmers will answer questions with theory, rather than code. This is for a few reasons. First of all, it is vital that a programmer know how to take a theory and implement it in code. Without this skill you will always have to rely on other people's samples to finish your projects, and chances are your final code will be a mess.
Second, as has been said, just having code does not tell you how the theory works.
__freon_inline extern float fracNoise(Vertex_S point){ float sum = 0, jl = 1; sum = perlinNoise(point); point.x *= 0.05f; point.y *= 0.05f; point.z *= 0.05f; for(unsigned long i=1; i<=5; i++) { point.x *= 7.1784f; point.y *= 7.1784f; point.z *= 7.1784f; sum += perlinNoise(point) * jl; jl *= 0.77f; } return sum;}
That doesn't teach you a lot about iterative noise functions, does it? It's an example of an iterative noise function, but you could stare at that code for days and never understand why it is doing what it does. Unless you are extremely experienced with writing noise functions, you won't be able to visualize the results, either - and if you are that experienced, you didn't need my code sample [wink] Now, if you manage to take that code and use it in a project, that's great - but what will you do when you have to change the way the function works? Will you just change the numbers in the function and guess, and maybe hope it looks right? Unless you know the theory, you cannot truly use the code - all you can do is copy and paste it.
Third, if you don't understand the theory behind things, they can seem like "magic." Magic is when things work but you can't explain how. Magic is extremely evil - if you write code that relies on magic, you are writing bad code. I'm not saying you have to know how quantum tunneling works in the transistors of a CPU to write javascript on a web page, but if you just copy and use code without understanding it, you are not writing code as well as you could be. The difference between a beginner and a master is that beginners have to do this - that's how we learn new things. A master never has to do it, because he has the knowledge and tools - the theory - to get things done in any situation.
A good programmer who gives you code to solve your problem is not doing you a favor. He is doing your work, whether it seems like it or not, and he is actually hurting you by making you rely on magic. A programmer who teaches you the theory of what you want to do, and maybe how to take some theory and make code with it - he has given you much more useful things. Give a man a fish, and he eats for a day; teach a man to fish and he eats for a lifetime. Give a man some code, and he has a cool program for a day; teach a man to code for himself and he can become a master.
Finally, as I started the post saying, programming is not about writing code. Writing code is what you do after your mind has finished programming and is ready to tell it to the computer. If you aren't thinking about and understanding the theory of the things you do in a program, you aren't programming - you're writing magic spells that make the computer do things.