I am using c++ now , but i'll try to do what you said CB
- knowing what part of your knowledge to apply to solve a particular problem, or alternatively finding out which knowledge you have to acquire in order to solve this problem (wikipedia, mathworld...), and then actually acquiring it and successfully applying it to solve the problem.
- Having someone do the job for you and tell you the exact algorithm that solves the problem or tell you what's wrong with your code.
Part of the challenge is to find what's wrong with your code, try different approaches etc. I can't tell you how many times I've struggled for days to find some sneaky bug in a code I've written, and I glad I did because it greatly improved my programming and debugging skills and sometimes even made me try and implement other algorithms which had the added benefit of greatly expanding my knowledge.
It is true that one can make one's life much easier by seeking final answers (and indeed there are number of sites that provide these answers), or ask for directions in various forums, but then he forfeits many of the foregoing benefits. Furthermore this "way of solving problems" distorts the ranking system in the project Euler site which is supposed to reflect the aggregate value, so to speak ,of ones logical, programming, research, learning... skills, relative to other users.
Okay, I actually don't accept the proposition that more difficult means better learned, in many cases, I think there is a parabolic relationship between learning and difficulty, where the most learning comes from a difficulty just a little beyond the current ability. Since each person's current ability is relative to them, I think it should be up to them to choose how difficult they want the problem to be for them.
As for knowing to go to Mathworld or Wikipedia, I don't think makes much difference here, you can't solve the problem without writing the code (most of the time), so asking for a hint vs getting it off of a website seems arbitrary to me. And since that argument is based on knowing where to get the information, and you've now spilled the beans on those sites, haven't you essentially given the hint? I just don't think that information should be hidden, I don't think that learning should be difficult. The difference between going to an encyclopedia entry and asking someone boils down to an ability to filter out irrelevant information, they person who already understands it can easily customize this information for you, and you can learn well (why, for instance, go to a math help forum, when all the information you need is in your book?)
Anyway, I am of the opinion that knowledge should be easy to access, a good textbook, a good website, a good screencast, a good mentor. I don't think that one tool for learning should be criticized simply because it is more effective than another tool for learning. If anything, this makes it a better tool.
And for the last part, let me preface it by stating that this is my own personal philosophy, and if you don't agree, that is okay: I don't think that comparing oneself to other people is a very healthy. If we want to be good at something, we should be able to do this because we want to be the best we can be, not because we want to be better than everyone else. Most of the great people of science far outpaced their peers, what if they gauged themselves simply off the relative scale of people around them? They would have satisfied their needs very quickly, and achieved far less. My point here is that the data on how much a person has achieved is compared at PE to how much other people have achieved, sure, but if this shouldn't be what drives us. For some, solving the first ten problems shows a marked increase in ability, for others, they can go well beyond the problems listed on PE. Should this first person's achievement be brushed aside because it still isn't as good as the second person's? No, a high ability only comes by building up a low ability, and for this person, they have built up that ability, it is an achievement for them. Should the second person start comparing him or herself to the first person? No, he is so far beyond the first person, what good could it possibly do? He should keep his focus on learning the new things available to him, solving the new problems that are just beyond his reach, looking ahead, not looking back.
So what my point here is, is that it is nice to see the data compared between people, but each person shouldn't judge themselves based on that data, and they shouldn't restrain their learning out of some goal to make the rating system reflect the most difficult possible approach. In fact, this rating system must surely be biased anyway, because many people come in, try a few problems, and then do not come back, so it is not a reflection of how well any given individual is compared with the others, there is an inflated lower proportion.
All that being said, there is certainly value in knowing how to debug your own problems, and perhaps he would have learned more had I suggested a debugging approach such as "Try running your algorithm on a smaller version of the problem that you can verify, for example, add the first two by hand, then run your program against them and see if it gives you what you expect. Then use this information to help you locate the problem in your code." But as he doesn't know what was wrong with his code (it could be a bug, or he could be completely off base, it could work correctly but his input file got messed up, etc), he doesn't know what to ask for help with. In this case, it is on me to give him the best help that I can give him. Perhaps I did not do this (that would be on me, not him). I will keep that approach in mind for the future if anyone asks for help.
So that got long, guess I should have had the morning coffee first. I hope it made sense, and didn't come off as confrontational. I just have strong opinions on education and knowledge, I suppose, as I dropped out of school the first time, and am currently going through again. I have to keep that love for learning burning within me, because even at school there doesn't seem to be much interest in keeping it lit.
WOW, thanks for that elaborate post, you have some reasonable arguments and I must say that for the most part I agree with you. I guess I just didn't like the way he phrased his post:
and I personally think, that you should not have given him the final answer, but again, that's only my personal opinion.If any one can tell me the right answer because when i type this number in the site it gives me a wrong answer ,and i don't know what's wrong with my program
I myself find it unfair that some functional languages such as MATLAB, Mathematica... are allowed to be used because they contain different ready to use algorithms, I know this to be especially true in matlab (from experience) which contains virtually endless amount of functions that implement algorithms from every branch and sub branch of numerous science fields. Thus using those functions in my opinion is like cheating.