hiukim's blog

By hiukim, 10 years ago, In English

I think most of us can agree that reading other people's submissions is a very good way to learn. Sometimes, I found that it might be even more effective to read a correct submission than editorial in order to understand the solutions. However, selecting a good submission to read could be difficult, especially when there are a lot of accepted ones.

To solve this problem, I think we can gather everyone's wisdom. My idea is that: whenever you read a solution and found it well written in the sense that it's easy to understand, then you just vote it up. At the end of the day, good submissions will stand out, and later on, people will know which submissions to read efficiently.

To try it out, I've developed a simple application which allow you to "Like" a submission. It is similar to the status page of a contest, containing the list of accepted submissions for a particular problem, but with a few extra features. Here is a sample contest URL: http://hiukim.com/cfsubmissions/contest.php?contestId=442. And here you can find other contests (I have currently crawled only 3 latest contests): http://hiukim.com/cfsubmissions/index.php

I think the community can benefit as a whole if we could collaborate in selecting good submissions. It might as well be a good way to encourage code readability. Any comments and suggestions are welcome. I hope we could try it out in the coming contest.

  • Vote: I like it
  • +125
  • Vote: I do not like it

»
10 years ago, # |
  Vote: I like it +7 Vote: I do not like it

Good idea — it will be useful!

»
10 years ago, # |
  Vote: I like it +9 Vote: I do not like it

You may also add overall ranking of submissions (merged list for all problems) and ranking of users (by sum of votes for all their submissions).

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Yeah. I have also thought about that. That seems to be a good "default" on new problems. :)

»
10 years ago, # |
  Vote: I like it +2 Vote: I do not like it

I agree!

»
10 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Very good idea. I myself have been confused with some submissions and tutorials. Hope the Codeforces admin and its staff will help you to develop this idea. If you need some help, feel free to ask for it in this blog.

»
10 years ago, # |
Rev. 3   Vote: I like it +26 Vote: I do not like it

That is a very nice tool and I guess you devoted it much effort, but I have to say that in my opinion that won't be that useful. Firstly, it will have point only if many people will use it and knowledge about it can quickly be smaller if this blog will disappear from "Recent actions" table. Secondly, with all due respect, tourist's solutions often doesn't look like elegant ones and easily readable for other people. At the moment, there are 4 likes in "Gena and Second Distance" and tourist received 3 of them, but in my opinion

double c = -a * x[i] - b * y[i];
double d = a * bb - b * aa;
xx[ncnt] = (b * cc - c * bb) / d;
yy[ncnt] = (c * aa - a * cc) / d;

doesn't look like a good example of elegant code. What I wanted to say is that I suspect that correlation of number of likes and high rating will be pretty big, when sometimes it shouldn't be, so this site may not be as useful as it could be. Maybe system of upvoting and downvoting will be better than system of upvoting only?

Some people have ability to write nonreadable code without any bugs, but I'm not one of them. I always try to use descriptive names of variables, avoid copy-paste and so on, it helps me to know what is going on in my code and it is harder to make bugs and easier to find them. There are some exceptions, for example when I find a bug and I got a feeling that it is last bug and I want to repair it as fast as I can or when I couldn't think of any descriptive name shorter than 5 words, but in general I try to make my code clear and I think that it is a good habit.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    I think you're right. There should be a high correlation between likes and ratings. Tourist's codes aren't my favorite too, no offense LOL. However, I expect that the results could still give us something useful, although not being perfect. A red coder might have advantages over a blue, but given two red coders, then it's more like a fair game, and I would believe that the better one will still receiver higher votes. To me, when I try to pick a submission to read, I do tend to start from higher rated coders, but the bias ends there and I don't think I will vote for it if I don't like it. Yeah, I guess allowing both up-votes and down-votes might serve better purpose in this sense.

    To solve the problem of not having this blog faded out, I guess what I'll try to do is to post it again on the next contest page after the contest end. That would be the time most people start reading submissions. I guess we will see if it works out or not.

  • »
    »
    10 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    BTW, this fragment is very clear — it calculates the intersection of two lines

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      a, aa, b, bb, c, cc, d, x, xx, y, yy, ox, oy, xm, ym, mn, km, n, nn, j, jj aren't names I will likely give to variables in my code :P. Though in geo problems I have to admit that it is more probable to use short names and few times I wrote sth like "xx" :P. Of course the most important thing is to write code without bugs as fast as possible, so if someone does it faster using such style, he shouldn't be concerned that this code may seem not readable to other people, but also shouldn't be surprised if other people say it is not as clear as it could be.

»
10 years ago, # |
Rev. 4   Vote: I like it +3 Vote: I do not like it

Come on guys! Let's vote for best submissions for last round.

hiukim can you add feature that searches user (by handle)?

»
10 years ago, # |
  Vote: I like it +12 Vote: I do not like it

Would it be feasible to turn your awesome idea into a plugin? (I just have no idea)

I agree with Swistakk that this tool only works if a lot of people use it; having to go to another webpage, which we won't rembeber, is a huge burden most won't feel like doing.

However installing a plugin once and then just clicking a button right next to a submission would probably become popular.

I know it's very easy to ask and (probably) hard to do, but I feel it's the only way to go from a good tool that nobody uses to a great tool that everyone uses.