Editorials: Add comments in problem setter's and tester's solution

I’ve been participating in CodeChef Long Contests for quite some time and love solving problems there. One of the key learnings after a contest is over is reading the editorials and writing code for problems which I was unable to solve during the contest.

I’ve noticed that although the quality of editorials is good most of the time, the code for hard problems could easily exceed 200 lines with not so intuitive variable/function names in the problem setter’s and tester’s solution. Case in point are these two solutions:

QRECT Setter’s solution

QRECT Tester’s solution

It’ll be great if the problem setters and testers added a well placed comment or two in the code around every important logic decision made, which will greatly help in understanding code of seemingly complex solutions. I’ve observed TopCoder and HackerRank editorials do this and I personally feel that it expedites the learning process of readers.

Moreover, those who are not so comfortable in the language chosen for writing the editorial solution will also be able to understand and quickly comprehend the code after reading the comments in the source code.

It’s a request to the admins to ensure that in future editorials, problem setters and testers solutions contain well placed comments explaining all the major logical decisions being made in the code.

2 Likes

Hi,

As a setter myself, I can say that this is (in theory) mandatory.

However, most of the setters/testers don’t do it because they feel that the editorialist can already clear things out immediately.

A good and trivial solution would be for the “Watcher” of the contest preparation to only declare a problem as “READY” when both solutions are well commented.

Best,

Bruno

2 Likes

I like what you’re suggesting. If CodeChef adopts this policy then it’ll greatly help the score of coders who regularly take part here. I tend to forget my own uncommented code, reading someone else’s code with no comments and that too of a difficult problem is even tougher.

I agree with what you say…add to that the fact that I’m not the brightest mind around here and my rating is just…terrible xD