CLASH OF CODE: Best Performance instead of Shortest

I suggest replacing the “Shortest” Mode with another mode comparing the time of execution.
the size of code may differ from a language to another, In C++ I find impossible to score less than 100 characters when others in Python or Perl or whatever do that job easily.
Optimizing the execution time of some code shows the real talent of a programmer not the length of code.

8 Likes

This would give an unfair advantage to those coding in C/C++, wouldn’t it?

1 Like

Maybe I’ll code in assembly then

and which is fairer ? best performance or shortest code ? people (clients) seek the speed of execution in our times not a short code
maybe adding the performance mode and keeping the shortest mode would be fairest

I’m not saying that the “code length” challenge is fair, I just doubt that replacing it with some other unfair challenge is the solution. :wink:

2 Likes

This would be awesome but it is currently difficult for us technically. Basically, the servers that run your solutions are not strictly identical so we would need to run the programs on the same server and they are also shared, which may influence a little the results too.

Plus, how do you evaluate a java program for instance? Do you take into consideration the time to launch the jvm? Do we need to do something specific for each programming language?

4 Likes

So, best performance is typically unfair, and technically difficult to put in place at that, while shortest code on the other hand is as unfair. Why not drop both ? :slight_smile: There can be ways other than execution time to measure performance and which are easy to measure and do not depend on the chosen language. In this respect, I think the optimization challenges for Mars Lander and Bilbo are really perfect !

Of course Mars Lander and Bilbo are not representative of the duration required for a clash of code. A possibility for such shorter challenges is to have an interaction between the server and the program and measure the number (or nature) of the interactions. Imagine for instance, that the program must play the hangman game or mastermind, and the performance is the number of tries before success. Or that we have something to do on a graph, but instead of being fed the whole structure of the graph at once, we must interact with the server to fetch the successors of any given node, you could measure how lazy/sparing the program was in exploring the graph. Make us sort some ordered abstract values, and we have no idea of what the order is so we must ask each time we compare two values, etc… All in all it’s a way to numb down the “complexity” of the program to the measure of some predefined actions that the servers can observe.

Of couse, this does not really apply to very short (5min) challenges which are just often about simple string processing. For these I would just recommend to drop the shortest code challenges and keep fastest submission as the only factor. it’s what that kind of programming is about: quickly get the job done :slight_smile:

Just throwing out ideas ! :wink:

3 Likes

Simply brilliant! I couldn’t agree more, I hope the CodinGame team will take that as a serious suggestion.

1 Like

The type of game you are describing is something we can do and we have planned to produce such kind of puzzles in the future. However, it would not be for Clash of Code but as new puzzles (at least, not in the near future).

But let’s be more technical :slight_smile: : for the kind of game you are describing, we need to run two programs, yours and the “referee”. This has two consequences:

  • it’s slower to test a solution which is bad for a 5mn clash for which you want to test your code very fast
  • it’s more difficult to create a question because you need to develop a new program each time and our objective is to provide a ton of questions

For these reasons, we have decided to use only “IN/OUT” puzzles: we provide an input, you give your answer on the output and we simply compare with the solution (that must be unique).

1 Like

I agree, I find it unfair too. When I used to code in ruby, I would code some task in one line for joy. So it’s interesting but unfair. Why not to pair similar language users for this kind of problem. Also when you see how many characters others used, whoever submits earlier has a disadvantage.

2 Likes

I know how it feels, say a problem have a in-build function in python, but not in java. then if you use java you need to write it yourself.

Thank you for digging up a 3 year old topic.
Regarding the unfairness of CoC, that’s nonsense as all the languages are available.
If a problem has a built-in function in python then use python…

Anyway, for CoC use ruby and like 5% of them would beat ruby in bash, perl or python.

Drop Java, it sucks.

Best performance can be measured in a fair way. For example: number of instructions executed.
Before compiling it would be possible to add debugging calls before each instruction in the source code, to be able to count them.

I am not sure which solution is the best,

Though, Having an option like “I want to code and compete with THIS_LANG” would help me learn the lang and see what like minded people do.

I do see advantage of allowing multiple languages. Just that I wanted to give an option to the Coder/user.

Well my suggestion will be Instead of code size or execution time wouldn’t it be better if you decide rank on the basis of submission time like who submit first with the correct code wins ???

What you describe is the “fastest mode”, which is one of the available modes right now :slight_smile:

1 Like