Time allowance for different languages

I noticed that some single player games allow more time for Python than e.g. C or Go.
Is this an official feature?

Actually, I think it would be nice to have time allowance depending on type of your language, especially for AI battles.
Brute force or extensive check being an important part of many strategies, the competition between bots in e.g. Python and C++ is not quite fair. Interpreted languages could enjoy higher time limits. What do you think?

5 Likes

I think that CodinGame is nice because it reflect real life.

If you are a professional developper and you have to build a software where performances are the biggest feature, you’ll never try to use anything else than C++.

6 Likes

Well, Halflings also have it hard in Blood Bowl! All the better when you manage to win a game against an C++ ork player.

3 Likes

Controlling a pod in a midiclorian field with varying degrees of physics satisfyingness… Writing a spell in forest runes… Saving the world by grouping colors and skulls… Fighting zombies…

Yup, this totally reflects real life. Let’s all use C++ :smiley:

6 Likes

The description of the problem may be abstract but the underlying solution and methods are very real.

2 Likes

What do you mean by “real”? I don’t think many of CodingGamers could use tricks developed here in their real-life jobs and vice-versa.

I’ll hazard that CG is cool because it’s somewhat different from everyday tasks. Problems are funny and algorithms are varying. It’s more likely that you saw some on them during your studies than in your job(s). For most part, you’ve probably learned it yourself with google (I have ;)).
More specifically, have you been using genetic algos for real? Monte Carlo tree search? Serious machine learning in your CV? Neural nets? Fake physics simulators? Even mini-max or A* are not very likely.

CG is more like a game, kinda sport. And sport means fair play, equal footing. In this perspective, there is nothing wrong with different time allowances for different languages.

And yet, various languages exist for a reason. IRL, we do need different tools. In CG framework it’s difficult to reflect all those real situations – but it’s pretty easy to put different tools on more equal footing.

5 Likes

I don’t agree with that. Codingame made me more “skilled” at coding. It’s hard to define but i’m just faster and more efficient at coding something.

But you are right on one thing : I’ll never use the C++ tricks i use on codingame in real life. Because in real life we have -O3 in the compilation command line :stuck_out_tongue:

1 Like

Considering following things:

  • Real world optimizations are forbidden (hello ‘The Accountant’)
  • Contests are dominated by C++ (you can compute more per 100 ms, also hi to ‘Smash the Code’)

I think the ‘real life’ argument is irrelevant and can’t be applied anymore.

Different languages need different time limits, so solutions on different languages can be truly competitive. And this is open opportunity to solve a contest on different language.

Examples: Java time = 2 * C++ time; Python time = 4 * C++ time.

4 Likes

So the meta becomes figuring out what language has the best arbitrary efficiency ratio instead? I am not sure that’s really making things better.

3 Likes

I think everyone have choice between high-level language (Java/Python/C#), low-level-performance © and ugly hybrid (C++), but requirements MUST be the same. If you think that one language has more pros than others - use this language.

2 Likes

Well, speaking LOUDLY doesn’t make an argument.
Basically you’re saying “One can choose their weapon, so no problem”.
But that’s beside the point.

The point is, there is a poor selection of weapons in the first place and there is a simple way to make it much more interesting.

Recently, with the rise of genetic algorithms, a typical contest becomes more and more an exercice of ugly C++ speed optimisation. I think this is not necessarily where we want to get.

A variable time allowance, could attract more people and more ideas on the board.

Actually, I do think it would be better.
The hard part is making it feasible at all.

With a large enough scale, it’d autobalance according to the average of the players’ results. But it’s still Damn Hard to get right.

Can you explain how gaming the efficiency metrics across languages would make things better? I can’t see. Here’s what I think is going to happen:

Let’s assume Python is, in general, 7 times slower than C++ at doing the computation you’re thinking of (if only real life was that easy, but let’s assume for the sake of discussion). But, arbitrarily, Python has been allowed 1000ms in CG, with C++ still at 100ms. So now instead of C++ being the de facto top language, it’s Python. And then you have to figure this out across the 20 or so languages hosted at CG.

In my opinion, that’s such a pointless diversion. At least right now, it maps fairly well to what happens in real life: if you need realtime performance, you will go with C++ or an equivalent. And learning how to optimize it, which is far from trivial if you look at all the underperforming C++ solutions in the leaderboard, will teach you valuable skills you can apply in the right kind of job.

It’s not hard to get those metrics right, I think it’s bordering the impossible. And personally, I wouldn’t want to be beaten by sloppy Python code after going hardcore optimization on my C++, just because it was arbitrarily given more processing time.

At least right now, I believe the rules are for the most part well known and fair. Could use more public information on the pragma stuff though.

5 Likes

Actually, it has been implemented in real life on some other site of this type. For example, python has been given 5 times C++’ allowance (there are many other languages for that matter). In this setting I’ve tried pretty many challenges both in python and in a fast compiled language (Go).

I think it works as expected. Still a bit easier to get the result in a compiled language. But, not surprisingly, at that point you can consider the advantage of rapid development in scripting languages. A very real life effect if you like. You choose your weapon, and this time the choice is real.

2 Likes

I think if there’d be less smash the code and more codebusters, then performance would be less relevant.

6 Likes

Just because they do it does not mean it’s fair. My opinion is I don’t want to see this on CG. It will simply shift the attention to the language who happens to have the better arbitrary metrics instead. Maybe better for some people who can’t/don’t want to use low level languages, but worse for those who can.

You can argue it’s possible to eventually achieve the right metrics. It might be possible, but I don’t believe it is.

I would argue you already have this rapid development advantage. Optimizing in C++ is already much more time consuming in contests. Why artificially make it worse? Imagine the code in Python being #1 with a large gap over C++ because of this arbitrary handicap? I don’t see the fairness.

If you want to go with as far as real life effects are concerned, programming includes choosing the right tool for the right job. And if you need realtime performance, you can bet C++ will not be far away, and you will get looks if you go with an interpreted language.

(No offense meant to Python users by the way, it is a great language, it is just also well known to be quite slow in general and makes an easy example).

Let’s put it straight. You believe its hardly possible to achieve perfect balance.
I’ve seen a real thing and it worked for me.

And with this experience, I’d say the point is not to achieve the perfect balance (which is undefined BTW).
It would be enough to make the gap just less blatant.
And one can tweak it to their liking (as many other things here on CG).

That’s simply not true. The current bias against interpreted languages is too strong. Just look at the leaderboards.

Speaking of performaces… Well, the problem is that on CG one gets nearly full advantage of C++ (i.e. its speed and a modern compiler) and not so much of e.g. Python. I wish CG installed standard modern Python modules, say cython or numba or SciPy/scikit-learn or maybe PyPy.

I bet the C++ lovers would then start to argue they want more time. :stuck_out_tongue:

Putting it further straight, those are both opinions, which are valid to discuss. Whether it works well or not for everyone on those other sites (mentioning them would be nice) or here on CG, is also a matter of opinion. I don’t see how it being implemented somewhere else somehow automatically invalidates the points I have mentioned. For all I know, it could be as bad as I have explained.

And in the end, we might just have to agree to disagree on whether artificial handicaps are a good thing or not.

I did not say it was an advantage on scoring well in current conditions, but on speed of development, of course. If the contest lasted 12 or 24 hours, then that advantage might probably translate better on the leaderboards. I have often seen solutions with interpreted languages topping the leaderboards in the beginning/middle of contests.

And I don’t think it’s an arbitrary bias, it’s the reality. If realtime levels of performance is an important factor to consider in a problem, then it definitely will impact the choice of language. If you don’t want that, I would rather argue like LBandy just did: design challenges promoting strategy over computation power, instead of going for artificial handicaps.

I am all with you on that. Anything that brings a language up to par to its full potential is a plus for everyone.

This is not a language war. I would love to code my solutions in C# in contests, this is by far my preferred language, but this will not happen if I judge performance will be too much an issue, so I just go with the best tool for the job. It just so happens most challenges are designed in a way that makes C++ be better suited for topping the leaderboards. If you want to argue to change that, I won’t stop you.

Wouldn’t want to intrude in your debate, but let me try to lay out the kind of system I’d like.

By comparing with the free market. What price is fair for a loaf of bread? (or a bowl of rice, or adjust to whatever your realm’s base food is)

All of those have influence on the matter: the value of money, the employee’s wages in the chain, the cost of production energy, buying the raw ingredients… Yet the price tends to stabilize (geographically). Because through supply and demand, all tend to balance, since any fluctuation is “discouraged” by the competition.

One way of reaching this that the C++ crowd is going to hate, is to give programs a time allowance in inverse relation with number of users in that language. You think you don’t have enough time? It’s your responsibility to find a language where the ratio between your estimated competence and the number of users. You think Python is allowed too much? You can get it reduced by using it.

What makes it hard to get right? I can think of this:

  • how stable should the time allowance be? realtime? hourly? daily? monthly? per-contest?
  • what’s a good inverse relation? proportional? capped? the CG-famous (N/P)^X?
  • how do you deal with the hordes of angry C++ coders?
1 Like

While I think it’s actually a really interesting idea for a single challenge, I think it would be a big mistake to apply this to the whole site. This is some meta-gamification that is massively distracting from the challenges themselves. This is fixing a ‘bias’ problem by introducing an even bigger one.

Also, since I read some comments suggesting so on the chat, I apologize if I somehow made this debate tense or unfriendly, my wording can probably use some work. Rest assured my intent is to be all friendly in debating this. :slight_smile:

2 Likes