Tuesday, November 26, 2013

Simpleton Geek Teaches Computer Programming Book 2 Ch 9D


9.4 The first significant program
“Well,” the teacher said. “It's good that you have it. Too bad that you didn't get it early enough to get points for it. What took you so long, anyway?”
Peter was in the teacher's office, reviewing the day's event as usual. Though he expected some other students to show up, nobody else showed up.
“Well,” Peter said carefully, “I guess it's the fact that parsing is such a difficult subject that I gave up immediately. It's not until I see that there really is no parsing involved that I understood the difficulty of the problem.”
“Which is?”
“Pulling one character off a string at a time, until the string becomes empty.”
“Is that a hard problem?”
“Not really.” Peter said, “I mean, it's not that easy. I'm still grasping the concept of string manipulation. But once I realize that you took a detour in explaining string operation, I knew that the knowledge is necessary to solve this problem, and I did some trial and error programming to try to understand it.”
“Ah, that's why it took you a long time. Had you done your homework properly and did the trial and error at home, you would have made it.”
“It's possible that it's true.” Peter acknowledged the possibility.
“You see, when you are faced with insurmountable problem, the first thing you did was to seek guidance. In this case, me, your teacher.”
“There's nothing wrong with that. Isn't that what school is all about?” asked Peter.
“Academia, maybe, but remember, I'm a professional. What would a professional do in such instances? Give up? Go back to school?”
“I guess not.”
“Then what would you do if you're a professional?”
Peter thought about it for awhile. “I guess, I'll be doing what I just did today.”
“Which was?”
“Just do my best in understanding the problem. Try as many solution as possible and see if I can solve the problem.”
“In fact, that is what professionals would do. And what everybody should do. The thing is, this is a school. Therefore, you know that you CAN solve the problem. The only question is how.
“Unfortunately, in the real world, that's not necessarily true. There are many problems in the real world that has no guarantee of having a solution at all. It may be one of those impossible problem. Do you understand?”
“I guess so.” said Peter. “I guess in that instance, it's okay for you not to solve the problem.”
“Well, there is a standard that we all have to adhere to. It's not okay to say that the problem is unsolvable. You have to provide PROOF that the problem is unsolvable. Otherwise, everybody can say that they worked on the problem. No standard.
“The most important thing,” the teacher continued, “is not that you actually solve the problem. But that you do enough work to see how close you can get to solve the problem. In the end, either you prove that the problem is an impossible problem, or you solve the problem.”
Peter thought for a while. “I guess next time I ran into a impossible problem, I have to show that it is impossible.”
“That's all I ask.” said the teacher.

No comments:

Post a Comment