[NSWI004] Copying code from labs

Vojtech Horky horky at d3s.mff.cuni.cz
Fri Nov 27 22:18:49 CET 2020


Hello.

Dne 27. 11. 20 v 21:37 Martin Zimen napsal(a):
> Hello,
>   I'm little bit confused how I'm supposed to proceed with 
> implementation of mutex when I attended the Friday labs. We were 
> presented with solution to the problem of mutex implementation and I 
> don't know how much are we now expected to come with a solution of our 
> own. Are we expected to just copy/rewrite the solution from labs and 
> tweak it a little bit to fit our existing code? Are we expected to 
> attend the labs and then, when implementing our solution, try to look 
> into it as little as possible? It's a little bit weird solving a problem 
> when I was already presented with a solution.

Sorry about the confusion, we should have stated this clearly at the 
beginning. You can use the code without any penalization. There is still 
plenty of other code to write (completely) by yourself :-)

> 
> Basically the question could be split into two parts - how much are we 
> *allowed* to copy presented solution and how would you *recommend* to 
> approach these labs (you mentioned you are considering to have more in 
> the future)? I mean do you recommend to attend the labs/watch the video 
> only if we are in trouble? Or should I attend the labs regardless (maybe 
> to learn development workflow, code style, etc; maybe it contains 
> important notes and thoughts to that subject)? Should I try to implement 
> the problem first and then watch the video to check my solution? Is it 
> useful to watch a solution after I implemented it when I have your 
> feedback to my code specifically (no irony intended, I'm genuinely 
> curious)? Do I loose anything when I copy the solution from video 
> instead of writing it from head?

Regarding the recommended approach: it really depends and all the 
options you listed may be reasonable.

If you have already attended the labs (or watched the video), it should 
probably help you jump-start your implementation. I really hope that you 
will not blindly copy the code but instead write it on your own and 
refer to our code only when lost.

If you have not yet watched the video but you know where to start and 
how to implement mutexes, then I would probably not waste time watching 
it. There are many more interesting videos out there ;-).

(On the other hand, we really are happy that you have come to the labs 
and asked questions as that helped us steer the level of explanations 
needed.)

I am afraid that after 3 assignments already done, it is a little late 
to show you the "right" development workflow. It would make sense a bit 
earlier but frankly we were pretty overloaded at the beginning of the 
semester.

I am not sure I understand the question about the feedback - we will 
comment your solution as if there was no lab. Frankly, I do not remember 
exactly how I implemented it (there are several options for the critical 
section handover etc. and I hate listening to myself on a video) so I 
will not be able to just skip it as "copied, correct". There might be 
other things said in the video that will not make it to the comments 
from us but it is maybe better not get overloaded.

Perhaps only the demonstration of using kq parameter in tests to hunt 
down race conditions is something new (about an hour into the lab). It 
is commented in README but not in great detail (but inspecting the fuzzy 
test suite is quite self-explanatory, I hope).

Hope this helps and that I have answered most of the questions.

Cheers,
- VH


More information about the NSWI004 mailing list