PDA

View Full Version : [SOLVED] Need Advice. Teacher Made a Mistake



TreeFinger
December 4th, 2007, 04:07 AM
I was working on a C++ program for HW for my intro to computer science class.

The program consists of a few functions that were provided to us by the professor. All we really needed to do was glue it all together in the main function. Anyways, I was running the program and I knew something was wrong. I printed out the 3 pages of code and began debugging by hand. I zeroed in on the function that was the cause of the problem and corrected the mistake. The program now works and displays accurate output.

What should I do? Should I confront the teacher about it or just hand in the homework?

I am not sure if anyone else in the class will take the time to try and work out the problem, if it is even noticed by anyone else. I am not sure if the teacher would like me correcting a problem with his code but by no means do I mean disrespect by it. What would you all do in my situation?

LaRoza
December 4th, 2007, 04:11 AM
What should I do? Should I confront the teacher about it or just hand in the homework?

I am not sure if anyone else in the class will take the time to try and work out the problem, if it is even noticed by anyone else. I am not sure if the teacher would like me correcting a problem with his code but by no means do I mean disrespect by it. What would you all do in my situation?

Good work! Finding errors in a source of information is a good thing.

I am sure the teacher will like it, if this teacher has any brains. Programming isn't about egos, it is about debugging (ask any programmer).

Instead of saying "Teacher, you were wrong", tell the problems you were getting, and how you fixed it.

If this problem isn't a real bug, the teacher will explain it, if it is (which is likely) it is a learning experience, which is what school is supposed to be.

TreeFinger
December 4th, 2007, 04:14 AM
Good work! Finding errors in a source of information is a good thing.

I am sure the teacher will like it, if this teacher has any brains. Programming isn't about egos, it is about debugging (ask any programmer).

Instead of saying "Teacher, you were wrong", tell the problems you were getting, and how you fixed it.



OK, do you think I should attempt to see what was wrong with his function? I wasn't really sure when reading it over. It was a binarySearch function for a single dimensional array. When I figured out which function was the problem I looked inside my book and tested the binary search function provided there and it fixed the problem.

LaRoza
December 4th, 2007, 04:16 AM
OK, do you think I should attempt to see what was wrong with his function? I wasn't really sure when reading it over. It was a binarySearch function for a single dimensional array. When I figured out which function was the problem I looked inside my book and tested the binary search function provided there and it fixed the problem.

If you don't understand what was exactly wrong, but were able to fix it. The teacher should be happy to explain it, if you explain what you did.

If I were a teacher, I would hate a class that passively accepted anything.

TreeFinger
December 4th, 2007, 04:25 AM
Well, I took your advice and e-mailed my professor. I hope he doesn't get upset about it. I wish I knew as much as him about programming languages. Maybe someday.. hehe. Thanks for the replies.

LaRoza
December 4th, 2007, 04:27 AM
Well, I took your advice and e-mailed my professor. I hope he doesn't get upset about it. I wish I knew as much as him about programming languages. Maybe someday.. hehe. Thanks for the replies.

If the teacher does get upset (which would be very odd), I suggest pointing out the fact that computers don't have feelings, they do exactly what you tell them to, and humans are the source of all errors (except in Vista, it is demonic).

jfinkels
December 4th, 2007, 04:29 AM
Well, I took your advice and e-mailed my professor. I hope he doesn't get upset about it. I wish I knew as much as him about programming languages. Maybe someday.. hehe. Thanks for the replies.

ALWAYS let teachers know when something like this happens! This means that you understand what is going on, and you are a diligent student. Teachers will (/should) never be upset by finding errors such as this!

TreeFinger
December 4th, 2007, 04:52 AM
Hah, funny story :popcorn:

His function works fine I believe. *AFTER* e-mailing, I decide to double check. Well, I'll definitely learn from that mistake.. double check, then e-mail :oops:.

I sent him an e-mail so quickly after I found out...

jflaker
December 4th, 2007, 04:59 AM
Don't say to the teacher they were wrong. Instead talk to him/her privately about what you found and how you fixed it. I doubt the code came directly from the teacher, but came from their text......which is assumed to be correct, but never is 100%.

If it were truly an error in the code, you finding the error means that your education was effective and you understand programming. The teacher should not get upset if you approach the error from a technical side instead of a personal side.

You may get extra credit for work beyond the curriculum.