View Single Post
Old 12-02-2012, 06:40 PM   PM User | #6
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,452
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
Quote:
Originally Posted by Philip M View Post
As this is plainly homework here is no point in offering the OP (this is his first post here) advanced/sophisticated solutions. Teacher may be dim, but not so dim as not to suspect external help!
Obviously the student can't hand in a real world solution to the problem in this type of situation since the real world solution uses commands that haven't been taught yet.

I disagree that there is no point in offering such solutions though.

1. The particular problem is one where there is a far better solution that the one the teacher expects so the particular question being asked is not one for which the code the teacher expects to be used in the answer would normally be used. (Why can't the teachers ask questions where the code being tested is appropriate to use for the solution?) So the student will know which way to go in trying to solve similar problems in the real world after they finish their course.

2. The person asking the question (and their fellow students) are not the only people who will ever be looking for solutions to that type of problem. By providing a real world solution those who are not students who have a similar problem they need to solve will see how to do it properly.

3. Those answering the question can improve their JavaScript skills when others offer an improvement on their solution.

Admittedly none of those get the student closer to being able to provide the answer that their dim teacher expects and so it is also necessary to provide advice as to how they should go about fixing the code they ask about in the first place. With the knowledge that such a solution is a long way from being the best way to solve that particular problem and that their teacher did not present them with a problem where the code that they are supposed to know would be the appropriate way to solve it.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/

Last edited by felgall; 12-02-2012 at 06:47 PM..
felgall is offline   Reply With Quote