reset password
Author Message
rabbott
Posts: 1649
Posted 15:52 Sep 04, 2019 |

Too many students write (or copy) code that they do not understand. When asked questions about how that code works, they are not able to answer. 

It's far more important to understand how code works than to create code from scratch. If you don't understand how the code you are presenting works, you get very little credit for it. You should be able to explain your code on both a high level, (a) what strategy does it use to accomplish its goals, and on a lower level, (b) how does the code, on a line-by-line basis, implement that strategy.

In addition, if the code uses operations or methods, you must understand and be able to explain what those operations or methods do.

For example, one student's code included code similar to this: frontier.pop(xyz). The frontier object was a queue, but the student didn't understand what the pop operation did or what effect its argument has. 

Another student's code included the expression: problem.getCostOfActions(). That method was not something he defined, which is fine, but the student was unable to explain what that method did or where it was defined. If you use a method, don't just treat it as magic that works in a certain context. You must understand more about it than simply that it makes your code work. 

Yet a third student used the + operation to concatenate two lists. That's fine. That's what it is intended for. The student didn't know that both arguments to + must be lists. If one of the arguments is not a list, the operation will fail.

As the title of this post says, if you don't understand something, post a question here on the Forum. Or if you prefer, ask your question on Stack Overflow. Either way is fine. But don't turn in something that you don't understand.

Last edited by rabbott at 21:28 Sep 04, 2019.